Class DefaultCsrfToken
java.lang.Object
org.springframework.security.web.csrf.DefaultCsrfToken
- All Implemented Interfaces:
Serializable
,CsrfToken
A CSRF token that is used to protect against CSRF attacks.
- Since:
- 3.2
- See Also:
-
Constructor Summary
ConstructorDescriptionDefaultCsrfToken
(String headerName, String parameterName, String token) Creates a new instance -
Method Summary
Modifier and TypeMethodDescriptionGets the HTTP header that the CSRF is populated on the response and can be placed on requests instead of the parameter.Gets the HTTP parameter name that should contain the token.getToken()
Gets the token value.
-
Constructor Details
-
DefaultCsrfToken
Creates a new instance- Parameters:
headerName
- the HTTP header name to useparameterName
- the HTTP parameter name to usetoken
- the value of the token (i.e. expected value of the HTTP parameter of parametername).
-
-
Method Details
-
getHeaderName
Description copied from interface:CsrfToken
Gets the HTTP header that the CSRF is populated on the response and can be placed on requests instead of the parameter. Cannot be null.- Specified by:
getHeaderName
in interfaceCsrfToken
- Returns:
- the HTTP header that the CSRF is populated on the response and can be placed on requests instead of the parameter
-
getParameterName
Description copied from interface:CsrfToken
Gets the HTTP parameter name that should contain the token. Cannot be null.- Specified by:
getParameterName
in interfaceCsrfToken
- Returns:
- the HTTP parameter name that should contain the token.
-
getToken
Description copied from interface:CsrfToken
Gets the token value. Cannot be null.
-