com.atlassian.jira.security.xsrf.XsrfTokenGenerator |
Known Indirect Subclasses |
Interface for generating anti-XSRF tokens for web forms.
The default implementation (available viw dependency injection) should be good enough for anyone, but this interface is provided just in case anyone wants to implement their own token generation strategy.Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | TOKEN_HTTP_SESSION_KEY | The name of the XSRF token put ino the HTTP session | |||||||||
String | TOKEN_WEB_PARAMETER_KEY | The name of the XSRF token parameter sent in on a web request |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gets the token from the current request, generating a new one if none is found
| |||||||||||
Gets the token from the current request, optionally generating a new one if none is found
| |||||||||||
Gets the token from the current request, optionally generating a new one if none is found
| |||||||||||
Gets the token from the current request, generating a new one if none is found
| |||||||||||
This method is deprecated.
since 4.3 - use the other two forms of generateToken()
| |||||||||||
This returns true of the token was generated by an authenticated user
| |||||||||||
Gets the token from the current request, generating a new one if none is found
| |||||||||||
Convenience method which will return the name to be used for a supplied XsrfToken in a request.
| |||||||||||
Validate a form token received as part of a web request
|
The name of the XSRF token put ino the HTTP session
The name of the XSRF token parameter sent in on a web request
Gets the token from the current request, generating a new one if none is found
request | the request the token is being generated for |
---|
Gets the token from the current request, optionally generating a new one if none is found
request | the request the token is being generated for |
---|---|
create | true to create token if none is found |
Gets the token from the current request, optionally generating a new one if none is found
create | true to create token if none is found |
---|
Gets the token from the current request, generating a new one if none is found
This method is deprecated.
since 4.3 - use the other two forms of generateToken()
Gets the token from the current request, generating a new one if none is found
request | the request the token is being generated for |
---|
This returns true of the token was generated by an authenticated user
token | the XSRF token in question |
---|
Gets the token from the current request, generating a new one if none is found
request | request that contains the form token. |
---|
Convenience method which will return the name to be used for a supplied XsrfToken in a request.
Validate a form token received as part of a web request
request | the request the token was received in |
---|---|
token | the token |