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 TypeMethodDescriptionvoidhandle(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 providedServerWebExchangeandCsrfTokenorMono.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- theServerWebExchangewith 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:ServerCsrfTokenRequestResolverReturns the token value resolved from the providedServerWebExchangeandCsrfTokenorMono.empty()if not available.- Specified by:
resolveCsrfTokenValuein interfaceServerCsrfTokenRequestResolver- Parameters:
exchange- theServerWebExchangewith the request being processedcsrfToken- theCsrfTokencreated by theServerCsrfTokenRepository- Returns:
- the token value resolved from the request
-