Interface ServerCsrfTokenRequestHandler
- All Superinterfaces:
ServerCsrfTokenRequestResolver
- All Known Implementing Classes:
ServerCsrfTokenRequestAttributeHandler
,XorServerCsrfTokenRequestAttributeHandler
- 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 ServerCsrfTokenRequestHandler
extends ServerCsrfTokenRequestResolver
A callback interface that is used to make the
CsrfToken
created by the
ServerCsrfTokenRepository
available as an exchange attribute. Implementations
of this interface may choose to perform additional tasks or customize how the token is
made available to the application through exchange attributes.- Since:
- 5.8
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
handle
(org.springframework.web.server.ServerWebExchange exchange, reactor.core.publisher.Mono<CsrfToken> csrfToken) Handles a request using aCsrfToken
.default reactor.core.publisher.Mono<String>
resolveCsrfTokenValue
(org.springframework.web.server.ServerWebExchange exchange, CsrfToken csrfToken) Returns the token value resolved from the providedServerWebExchange
andCsrfToken
orMono.empty()
if not available.
-
Method Details
-
handle
void handle(org.springframework.web.server.ServerWebExchange exchange, reactor.core.publisher.Mono<CsrfToken> csrfToken) Handles a request using aCsrfToken
.- Parameters:
exchange
- theServerWebExchange
with the request being handledcsrfToken
- theMono<CsrfToken>
created by theServerCsrfTokenRepository
-
resolveCsrfTokenValue
default reactor.core.publisher.Mono<String> resolveCsrfTokenValue(org.springframework.web.server.ServerWebExchange exchange, CsrfToken csrfToken) Description copied from interface:ServerCsrfTokenRequestResolver
Returns the token value resolved from the providedServerWebExchange
andCsrfToken
orMono.empty()
if not available.- Specified by:
resolveCsrfTokenValue
in interfaceServerCsrfTokenRequestResolver
- Parameters:
exchange
- theServerWebExchange
with the request being processedcsrfToken
- theCsrfToken
created by theServerCsrfTokenRepository
- Returns:
- the token value resolved from the request
-