@Component(roles=org.xwiki.script.service.ScriptService.class) @Named(value="csrf") @Singleton public class CSRFTokenScriptService extends Object implements CSRFToken, org.xwiki.script.service.ScriptService
CSRFToken component.| Constructor and Description |
|---|
CSRFTokenScriptService() |
| Modifier and Type | Method and Description |
|---|---|
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. |
public String getToken()
CSRFTokengetToken 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 requesttrue if the component is disabled or the given token is correct, false otherwisepublic String getResubmissionURL()
CSRFTokengetResubmissionURL in interface CSRFTokenCopyright © 2004–2018 XWiki. All rights reserved.