Class SwitchUserConfigurer<H extends org.springframework.security.config.annotation.web.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<SwitchUserConfigurer<H>,H>
-
- com.flowable.core.spring.security.switchuser.SwitchUserConfigurer<H>
-
- All Implemented Interfaces:
org.springframework.security.config.annotation.SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,H>
public class SwitchUserConfigurer<H extends org.springframework.security.config.annotation.web.HttpSecurityBuilder<H>> extends org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer<SwitchUserConfigurer<H>,H>
- Author:
- Filip Hrisafov
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classSwitchUserConfigurer.FilterSecurityInterceptorPostProcessor
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringcookieDomainprotected java.time.DurationcookieMaxAgeprotected java.lang.StringcookieNameprotected java.lang.StringexitUserUrlprotected org.springframework.security.config.annotation.ObjectPostProcessor<org.springframework.security.web.access.intercept.FilterSecurityInterceptor>filterSecurityInterceptorObjectPostProcessorprotected java.util.Collection<ImpersonatePermissionVoter>impersonatePermissionVotersprotected java.lang.Stringkeyprotected FlowableSwitchUserHandlerswitchUserHandlerprotected java.lang.StringswitchUserUrlprotected org.springframework.security.core.userdetails.UserDetailsServiceuserDetailsService
-
Constructor Summary
Constructors Constructor Description SwitchUserConfigurer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure(H builder)SwitchUserConfigurer<H>cookieDomain(java.lang.String cookieDomain)The domain of the run as user cookie.SwitchUserConfigurer<H>cookieMaxAge(java.time.Duration cookieMaxAge)The max age for the run as user cookie.SwitchUserConfigurer<H>cookieName(java.lang.String cookieName)The name of the run as user cookie.SwitchUserConfigurer<H>exitUserUrl(java.lang.String exitUserUrl)The URL to respond to exit the user switching.protected org.springframework.security.core.userdetails.UserDetailsServicegetUserDetailsService(org.springframework.context.ApplicationContext applicationContext)SwitchUserConfigurer<H>impersonatePermissionVoter(ImpersonatePermissionVoter impersonatePermissionVoter)Add anImpersonatePermissionVoter.voidinit(H builder)SwitchUserConfigurer<H>key(java.lang.String key)The key for the run as user token.SwitchUserConfigurer<H>switchUserUrl(java.lang.String switchUserUrl)The URL to respond to switch the user processing.-
Methods inherited from class org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer
disable, withObjectPostProcessor
-
-
-
-
Field Detail
-
key
protected java.lang.String key
-
cookieName
protected java.lang.String cookieName
-
cookieMaxAge
protected java.time.Duration cookieMaxAge
-
cookieDomain
protected java.lang.String cookieDomain
-
exitUserUrl
protected java.lang.String exitUserUrl
-
switchUserUrl
protected java.lang.String switchUserUrl
-
switchUserHandler
protected FlowableSwitchUserHandler switchUserHandler
-
userDetailsService
protected org.springframework.security.core.userdetails.UserDetailsService userDetailsService
-
impersonatePermissionVoters
protected java.util.Collection<ImpersonatePermissionVoter> impersonatePermissionVoters
-
filterSecurityInterceptorObjectPostProcessor
protected org.springframework.security.config.annotation.ObjectPostProcessor<org.springframework.security.web.access.intercept.FilterSecurityInterceptor> filterSecurityInterceptorObjectPostProcessor
-
-
Method Detail
-
key
public SwitchUserConfigurer<H> key(java.lang.String key)
The key for the run as user token.- Parameters:
key- the key for the token- Returns:
- the
SwitchUserConfigurerfor further customization
-
cookieName
public SwitchUserConfigurer<H> cookieName(java.lang.String cookieName)
The name of the run as user cookie.- Parameters:
cookieName- the name of the cookie- Returns:
- the
SwitchUserConfigurerfor further customization
-
cookieMaxAge
public SwitchUserConfigurer<H> cookieMaxAge(java.time.Duration cookieMaxAge)
The max age for the run as user cookie.- Parameters:
cookieMaxAge- the max age of the cookie- Returns:
- the
SwitchUserConfigurerfor further customization
-
cookieDomain
public SwitchUserConfigurer<H> cookieDomain(java.lang.String cookieDomain)
The domain of the run as user cookie.- Parameters:
cookieDomain- the domain of the cookie- Returns:
- the
SwitchUserConfigurerfor further customization
-
switchUserUrl
public SwitchUserConfigurer<H> switchUserUrl(java.lang.String switchUserUrl)
The URL to respond to switch the user processing.- Parameters:
switchUserUrl- the switch user URL- Returns:
- the
SwitchUserConfigurerfor further customization
-
exitUserUrl
public SwitchUserConfigurer<H> exitUserUrl(java.lang.String exitUserUrl)
The URL to respond to exit the user switching.- Parameters:
exitUserUrl- the switch user URL- Returns:
- the
SwitchUserConfigurerfor further customization
-
impersonatePermissionVoter
public SwitchUserConfigurer<H> impersonatePermissionVoter(ImpersonatePermissionVoter impersonatePermissionVoter)
Add anImpersonatePermissionVoter.- Parameters:
impersonatePermissionVoter- the impersonate permission voter to be added to the configurer.- Returns:
- the
SwitchUserConfigurerfor further customization
-
init
public void init(H builder)
- Specified by:
initin interfaceorg.springframework.security.config.annotation.SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,H extends org.springframework.security.config.annotation.web.HttpSecurityBuilder<H>>- Overrides:
initin classorg.springframework.security.config.annotation.SecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain,H extends org.springframework.security.config.annotation.web.HttpSecurityBuilder<H>>
-
configure
public void configure(H builder) throws java.lang.Exception
- Specified by:
configurein interfaceorg.springframework.security.config.annotation.SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,H extends org.springframework.security.config.annotation.web.HttpSecurityBuilder<H>>- Overrides:
configurein classorg.springframework.security.config.annotation.SecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain,H extends org.springframework.security.config.annotation.web.HttpSecurityBuilder<H>>- Throws:
java.lang.Exception
-
getUserDetailsService
protected org.springframework.security.core.userdetails.UserDetailsService getUserDetailsService(org.springframework.context.ApplicationContext applicationContext)
-
-