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 class
SwitchUserConfigurer.FilterSecurityInterceptorPostProcessor
-
Field Summary
Fields Modifier and Type Field Description protected String
cookieDomain
protected Duration
cookieMaxAge
protected String
cookieName
protected String
exitUserUrl
protected ObjectPostProcessor<FilterSecurityInterceptor>
filterSecurityInterceptorObjectPostProcessor
protected Collection<ImpersonatePermissionVoter>
impersonatePermissionVoters
protected String
key
protected FlowableSwitchUserHandler
switchUserHandler
protected String
switchUserUrl
protected UserDetailsService
userDetailsService
-
Constructor Summary
Constructors Constructor Description SwitchUserConfigurer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(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 UserDetailsService
getUserDetailsService(ApplicationContext applicationContext)
SwitchUserConfigurer<H>
impersonatePermissionVoter(ImpersonatePermissionVoter impersonatePermissionVoter)
Add anImpersonatePermissionVoter
.void
init(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
SwitchUserConfigurer
for 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
SwitchUserConfigurer
for 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
SwitchUserConfigurer
for 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
SwitchUserConfigurer
for 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
SwitchUserConfigurer
for 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
SwitchUserConfigurer
for 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
SwitchUserConfigurer
for further customization
-
init
public void init(H builder)
- Specified by:
init
in interfaceSecurityConfigurer<DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>
- Overrides:
init
in classSecurityConfigurerAdapter<DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>
-
configure
public void configure(H builder) throws Exception
- Specified by:
configure
in interfaceSecurityConfigurer<DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>
- Overrides:
configure
in classSecurityConfigurerAdapter<DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>
- Throws:
Exception
-
getUserDetailsService
protected UserDetailsService getUserDetailsService(ApplicationContext applicationContext)
-
-