|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xwiki.csrf.script.CSRFTokenScriptService
@Component(roles=org.xwiki.script.service.ScriptService.class) @Named(value="csrf") @Singleton public class CSRFTokenScriptService
Script service wrapping a CSRFToken component.
| Constructor Summary | |
|---|---|
CSRFTokenScriptService()
|
|
| Method Summary | |
|---|---|
void |
clearToken()
Removes the anti-CSRF token associated with the current user. |
String |
getResubmissionURL()
Get the URL where a failed request should be redirected to. |
String |
getToken()
Returns the anti-CSRF token associated with the current user. |
boolean |
isTokenValid(String token)
Check if the given token matches the internally stored token associated with the current user. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CSRFTokenScriptService()
| Method Detail |
|---|
public String getToken()
CSRFToken
getToken in interface CSRFTokenCSRFToken.isTokenValid(String)public void clearToken()
CSRFTokenCSRFToken.getToken() will generate a fresh token.
clearToken in interface CSRFTokenpublic boolean isTokenValid(String token)
CSRFTokentoken matches the internally stored token associated with the current user.
isTokenValid in interface CSRFTokentoken - random token from the request
true if the component is disabled or the given token is correct, false otherwisepublic String getResubmissionURL()
CSRFToken
getResubmissionURL in interface CSRFToken
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||