Class SecurityContextConfigurer<H extends HttpSecurityBuilder<H>>

java.lang.Object
org.springframework.security.config.annotation.SecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain,B>
org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer<SecurityContextConfigurer<H>,H>
org.springframework.security.config.annotation.web.configurers.SecurityContextConfigurer<H>
All Implemented Interfaces:
SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,H>

public final class SecurityContextConfigurer<H extends HttpSecurityBuilder<H>> extends AbstractHttpConfigurer<SecurityContextConfigurer<H>,H>
Allows persisting and restoring of the SecurityContext found on the SecurityContextHolder for each request by configuring the SecurityContextPersistenceFilter. All properties have reasonable defaults, so no additional configuration is required other than applying this SecurityConfigurer.

Security Filters

The following Filters are populated
  • SecurityContextPersistenceFilter

Shared Objects Created

No shared objects are created.

Shared Objects Used

The following shared objects are used:
  • If SessionManagementConfigurer, is provided and set to always, then the SecurityContextPersistenceFilter.setForceEagerSessionCreation(boolean) will be set to true.
  • SecurityContextRepository must be set and is used on SecurityContextPersistenceFilter.
Since:
3.2