public class WebSessionServerSecurityContextRepository extends java.lang.Object implements ServerSecurityContextRepository
SecurityContext in the
WebSession. When a SecurityContext is
saved, the session id is changed to prevent session fixation attacks.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_SPRING_SECURITY_CONTEXT_ATTR_NAME
The default session attribute name to save and load the
SecurityContext |
| Constructor and Description |
|---|
WebSessionServerSecurityContextRepository() |
| Modifier and Type | Method and Description |
|---|---|
reactor.core.publisher.Mono<org.springframework.security.core.context.SecurityContext> |
load(org.springframework.web.server.ServerWebExchange exchange)
Loads the SecurityContext associated with the
ServerWebExchange |
reactor.core.publisher.Mono<java.lang.Void> |
save(org.springframework.web.server.ServerWebExchange exchange,
org.springframework.security.core.context.SecurityContext context)
Saves the SecurityContext
|
void |
setSpringSecurityContextAttrName(java.lang.String springSecurityContextAttrName)
Sets the session attribute name used to save and load the
SecurityContext |
public static final java.lang.String DEFAULT_SPRING_SECURITY_CONTEXT_ATTR_NAME
SecurityContextpublic WebSessionServerSecurityContextRepository()
public void setSpringSecurityContextAttrName(java.lang.String springSecurityContextAttrName)
SecurityContextspringSecurityContextAttrName - the session attribute name to use to save and
load the SecurityContextpublic reactor.core.publisher.Mono<java.lang.Void> save(org.springframework.web.server.ServerWebExchange exchange,
org.springframework.security.core.context.SecurityContext context)
ServerSecurityContextRepositorysave in interface ServerSecurityContextRepositoryexchange - the exchange to associate to the SecurityContextcontext - the SecurityContext to savepublic reactor.core.publisher.Mono<org.springframework.security.core.context.SecurityContext> load(org.springframework.web.server.ServerWebExchange exchange)
ServerSecurityContextRepositoryServerWebExchangeload in interface ServerSecurityContextRepositoryexchange - the exchange to look up the SecurityContextSecurityContext to lookup or empty if not found. Never null