Class SwitchUserConfigurer<H extends HttpSecurityBuilder<H>>
- java.lang.Object
-
- org.springframework.security.config.annotation.SecurityConfigurerAdapter<DefaultSecurityFilterChain,B>
-
- org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer<SwitchUserConfigurer<H>,H>
-
- com.flowable.core.spring.security.switchuser.SwitchUserConfigurer<H>
-
- All Implemented Interfaces:
SecurityConfigurer<DefaultSecurityFilterChain,H>
public class SwitchUserConfigurer<H extends HttpSecurityBuilder<H>> extends 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 StringcookieDomainprotected DurationcookieMaxAgeprotected StringcookieNameprotected StringexitUserUrlprotected ObjectPostProcessor<FilterSecurityInterceptor>filterSecurityInterceptorObjectPostProcessorprotected Collection<ImpersonatePermissionVoter>impersonatePermissionVotersprotected Stringkeyprotected FlowableSwitchUserHandlerswitchUserHandlerprotected StringswitchUserUrlprotected 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(String cookieDomain)The domain of the run as user cookie.SwitchUserConfigurer<H>cookieMaxAge(Duration cookieMaxAge)The max age for the run as user cookie.SwitchUserConfigurer<H>cookieName(String cookieName)The name of the run as user cookie.SwitchUserConfigurer<H>exitUserUrl(String exitUserUrl)The URL to respond to exit the user switching.protected UserDetailsServicegetUserDetailsService(ApplicationContext applicationContext)SwitchUserConfigurer<H>impersonatePermissionVoter(ImpersonatePermissionVoter impersonatePermissionVoter)Add anImpersonatePermissionVoter.voidinit(H builder)SwitchUserConfigurer<H>key(String key)The key for the run as user token.SwitchUserConfigurer<H>switchUserUrl(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
-
Methods inherited from class org.springframework.security.config.annotation.SecurityConfigurerAdapter
addObjectPostProcessor, and, getBuilder, postProcess, setBuilder
-
-
-
-
Field Detail
-
key
protected String key
-
cookieName
protected String cookieName
-
cookieMaxAge
protected Duration cookieMaxAge
-
cookieDomain
protected String cookieDomain
-
exitUserUrl
protected String exitUserUrl
-
switchUserUrl
protected String switchUserUrl
-
switchUserHandler
protected FlowableSwitchUserHandler switchUserHandler
-
userDetailsService
protected UserDetailsService userDetailsService
-
impersonatePermissionVoters
protected Collection<ImpersonatePermissionVoter> impersonatePermissionVoters
-
filterSecurityInterceptorObjectPostProcessor
protected ObjectPostProcessor<FilterSecurityInterceptor> filterSecurityInterceptorObjectPostProcessor
-
-
Method Detail
-
key
public SwitchUserConfigurer<H> key(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(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(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(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(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(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 interfaceSecurityConfigurer<DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>- Overrides:
initin classSecurityConfigurerAdapter<DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>
-
configure
public void configure(H builder) throws Exception
- Specified by:
configurein interfaceSecurityConfigurer<DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>- Overrides:
configurein classSecurityConfigurerAdapter<DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>- Throws:
Exception
-
getUserDetailsService
protected UserDetailsService getUserDetailsService(ApplicationContext applicationContext)
-
-