public class WebSessionServerCsrfTokenRepository extends java.lang.Object implements ServerCsrfTokenRepository
| Constructor and Description |
|---|
WebSessionServerCsrfTokenRepository() |
| Modifier and Type | Method and Description |
|---|---|
reactor.core.publisher.Mono<CsrfToken> |
generateToken(org.springframework.web.server.ServerWebExchange exchange)
Generates a
CsrfToken |
reactor.core.publisher.Mono<CsrfToken> |
loadToken(org.springframework.web.server.ServerWebExchange exchange)
Loads the expected
CsrfToken from the ServerWebExchange |
reactor.core.publisher.Mono<java.lang.Void> |
saveToken(org.springframework.web.server.ServerWebExchange exchange,
CsrfToken token)
Saves the
CsrfToken using the ServerWebExchange. |
void |
setHeaderName(java.lang.String headerName)
|
void |
setParameterName(java.lang.String parameterName)
Sets the
HttpServletRequest parameter name that the CsrfToken is
expected to appear on |
void |
setSessionAttributeName(java.lang.String sessionAttributeName)
Sets the
HttpSession attribute name that the CsrfToken is stored in |
public reactor.core.publisher.Mono<CsrfToken> generateToken(org.springframework.web.server.ServerWebExchange exchange)
ServerCsrfTokenRepositoryCsrfTokengenerateToken in interface ServerCsrfTokenRepositoryexchange - the ServerWebExchange to useCsrfToken that was generated. Cannot be null.public reactor.core.publisher.Mono<java.lang.Void> saveToken(org.springframework.web.server.ServerWebExchange exchange,
CsrfToken token)
ServerCsrfTokenRepositoryCsrfToken using the ServerWebExchange. If the
CsrfToken is null, it is the same as deleting it.saveToken in interface ServerCsrfTokenRepositoryexchange - the ServerWebExchange to usetoken - the CsrfToken to save or null to deletepublic reactor.core.publisher.Mono<CsrfToken> loadToken(org.springframework.web.server.ServerWebExchange exchange)
ServerCsrfTokenRepositoryCsrfToken from the ServerWebExchangeloadToken in interface ServerCsrfTokenRepositoryexchange - the ServerWebExchange to useCsrfToken or null if none existspublic void setParameterName(java.lang.String parameterName)
HttpServletRequest parameter name that the CsrfToken is
expected to appear onparameterName - the new parameter name to usepublic void setHeaderName(java.lang.String headerName)
CsrfToken is expected to appear on and the
header that the response will contain the CsrfToken.headerName - the new header name to usepublic void setSessionAttributeName(java.lang.String sessionAttributeName)
HttpSession attribute name that the CsrfToken is stored insessionAttributeName - the new attribute name to use