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 class
SwitchUserConfigurer.FilterSecurityInterceptorPostProcessor
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
cookieDomain
protected java.time.Duration
cookieMaxAge
protected java.lang.String
cookieName
protected java.lang.String
exitUserUrl
protected org.springframework.security.config.annotation.ObjectPostProcessor<org.springframework.security.web.access.intercept.FilterSecurityInterceptor>
filterSecurityInterceptorObjectPostProcessor
protected java.util.Collection<ImpersonatePermissionVoter>
impersonatePermissionVoters
protected java.lang.String
key
protected FlowableSwitchUserHandler
switchUserHandler
protected java.lang.String
switchUserUrl
protected org.springframework.security.core.userdetails.UserDetailsService
userDetailsService
-
Constructor Summary
Constructors Constructor Description SwitchUserConfigurer()
-
Method Summary
Modifier and Type Method Description void
configure(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.UserDetailsService
getUserDetailsService(org.springframework.context.ApplicationContext applicationContext)
SwitchUserConfigurer<H>
impersonatePermissionVoter(ImpersonatePermissionVoter impersonatePermissionVoter)
Add anImpersonatePermissionVoter
.void
init(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 Details
-
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
-
userDetailsService
protected org.springframework.security.core.userdetails.UserDetailsService userDetailsService -
impersonatePermissionVoters
-
filterSecurityInterceptorObjectPostProcessor
protected org.springframework.security.config.annotation.ObjectPostProcessor<org.springframework.security.web.access.intercept.FilterSecurityInterceptor> filterSecurityInterceptorObjectPostProcessor
-
-
Constructor Details
-
SwitchUserConfigurer
public SwitchUserConfigurer()
-
-
Method Details
-
key
The key for the run as user token.- Parameters:
key
- the key for the token- Returns:
- the
SwitchUserConfigurer
for further customization
-
cookieName
The name of the run as user cookie.- Parameters:
cookieName
- the name of the cookie- Returns:
- the
SwitchUserConfigurer
for further customization
-
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
The domain of the run as user cookie.- Parameters:
cookieDomain
- the domain of the cookie- Returns:
- the
SwitchUserConfigurer
for further customization
-
switchUserUrl
The URL to respond to switch the user processing.- Parameters:
switchUserUrl
- the switch user URL- Returns:
- the
SwitchUserConfigurer
for further customization
-
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
- Specified by:
init
in interfaceorg.springframework.security.config.annotation.SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,H extends org.springframework.security.config.annotation.web.HttpSecurityBuilder<H>>
- Overrides:
init
in classorg.springframework.security.config.annotation.SecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain,H extends org.springframework.security.config.annotation.web.HttpSecurityBuilder<H>>
-
configure
- Specified by:
configure
in interfaceorg.springframework.security.config.annotation.SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,H extends org.springframework.security.config.annotation.web.HttpSecurityBuilder<H>>
- Overrides:
configure
in 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)
-