Class DefaultCsrfToken
java.lang.Object
org.springframework.security.web.server.csrf.DefaultCsrfToken
- All Implemented Interfaces:
Serializable
,CsrfToken
A CSRF token that is used to protect against CSRF attacks.
- Since:
- 5.0
- See Also:
-
Constructor Summary
ConstructorDescriptionDefaultCsrfToken
(String headerName, String parameterName, String token) Creates a new instance -
Method Summary
-
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. -
equals
-
hashCode
public int hashCode()
-