Interface ServerCsrfTokenRepository
-
- All Known Implementing Classes:
CookieServerCsrfTokenRepository,WebSessionServerCsrfTokenRepository
public interface ServerCsrfTokenRepositoryAn API to allow changing the method in which the expectedCsrfTokenis associated to theServerWebExchange. For example, it may be stored inWebSession.- Since:
- 5.0
- See Also:
WebSessionServerCsrfTokenRepository
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description reactor.core.publisher.Mono<CsrfToken>generateToken(org.springframework.web.server.ServerWebExchange exchange)Generates aCsrfTokenreactor.core.publisher.Mono<CsrfToken>loadToken(org.springframework.web.server.ServerWebExchange exchange)Loads the expectedCsrfTokenfrom theServerWebExchangereactor.core.publisher.Mono<java.lang.Void>saveToken(org.springframework.web.server.ServerWebExchange exchange, CsrfToken token)Saves theCsrfTokenusing theServerWebExchange.
-
-
-
Method Detail
-
generateToken
reactor.core.publisher.Mono<CsrfToken> generateToken(org.springframework.web.server.ServerWebExchange exchange)
Generates aCsrfToken- Parameters:
exchange- theServerWebExchangeto use- Returns:
- the
CsrfTokenthat was generated. Cannot be null.
-
saveToken
reactor.core.publisher.Mono<java.lang.Void> saveToken(org.springframework.web.server.ServerWebExchange exchange, CsrfToken token)Saves theCsrfTokenusing theServerWebExchange. If theCsrfTokenis null, it is the same as deleting it.- Parameters:
exchange- theServerWebExchangeto usetoken- theCsrfTokento save or null to delete
-
-