Interface CsrfTokenRequestHandler
-
- All Superinterfaces:
CsrfTokenRequestResolver
- All Known Implementing Classes:
CsrfTokenRequestAttributeHandler
,XorCsrfTokenRequestAttributeHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface CsrfTokenRequestHandler extends CsrfTokenRequestResolver
A callback interface that is used to make theCsrfToken
created by theCsrfTokenRepository
available as a request attribute. Implementations of this interface may choose to perform additional tasks or customize how the token is made available to the application through request attributes.- Since:
- 5.8
- See Also:
CsrfTokenRequestAttributeHandler
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
handle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.util.function.Supplier<CsrfToken> csrfToken)
Handles a request using aCsrfToken
.default java.lang.String
resolveCsrfTokenValue(javax.servlet.http.HttpServletRequest request, CsrfToken csrfToken)
Returns the token value resolved from the providedHttpServletRequest
andCsrfToken
ornull
if not available.
-
-
-
Method Detail
-
handle
void handle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.util.function.Supplier<CsrfToken> csrfToken)
Handles a request using aCsrfToken
.- Parameters:
request
- theHttpServletRequest
being handledresponse
- theHttpServletResponse
being handledcsrfToken
- theCsrfToken
created by theCsrfTokenRepository
-
resolveCsrfTokenValue
default java.lang.String resolveCsrfTokenValue(javax.servlet.http.HttpServletRequest request, CsrfToken csrfToken)
Description copied from interface:CsrfTokenRequestResolver
Returns the token value resolved from the providedHttpServletRequest
andCsrfToken
ornull
if not available.- Specified by:
resolveCsrfTokenValue
in interfaceCsrfTokenRequestResolver
- Parameters:
request
- theHttpServletRequest
being processedcsrfToken
- theCsrfToken
created by theCsrfTokenRepository
- Returns:
- the token value resolved from the request
-
-