Package org.springframework.security.web.csrf
@NullMarked
package org.springframework.security.web.csrf
APIs for protection against CSRF attacks.
-
ClassDescriptionA
CsrfTokenRepositorythat persists the CSRF token in a cookie named "XSRF-TOKEN" and reads from the header "X-XSRF-TOKEN" following the conventions of AngularJS.CsrfAuthenticationStrategyis in charge of removing theCsrfTokenupon authenticating.Thrown when an invalid or missingCsrfTokenis found in the HttpServletRequestApplies CSRF protection using a synchronizer token pattern.CsrfLogoutHandleris in charge of removing theCsrfTokenupon logout.Provides the information about an expected CSRF token.An API to allow changing the method in which the expectedCsrfTokenis associated to theHttpServletRequest.An implementation of theCsrfTokenRequestHandlerinterface that is capable of making theCsrfTokenavailable as a request attribute and resolving the token value as either a header or parameter value of the request.A callback interface that is used to make theCsrfTokencreated by theCsrfTokenRepositoryavailable as a request attribute.Implementations of this interface are capable of resolving the token value of aCsrfTokenfrom the providedHttpServletRequest.A CSRF token that is used to protect against CSRF attacks.An interface that allows delayed access to aCsrfTokenthat may be generated.Thrown when an expectedCsrfTokenexists, but it does not match the value present on theHttpServletRequestThrown when no expectedCsrfTokenis found but is required.An implementation of theCsrfTokenRequestHandlerinterface that is capable of masking the value of theCsrfTokenon each request and resolving the raw token value from the masked value as either a header or parameter value of the request.