public class FlowableSwitchUserHandler extends Object implements AuthenticationSuccessHandler, AuthenticationFailureHandler, LogoutHandler, RunAsManager, SwitchUserAuthorityChanger, InitializingBean
Modifier and Type | Field and Description |
---|---|
protected String |
cookieDomain |
protected int |
cookieMaxAgeInSeconds |
protected String |
cookieName |
protected Collection<ImpersonatePermissionVoter> |
impersonatePermissionVoters |
protected String |
key |
protected UserDetailsService |
userDetailsService |
Constructor and Description |
---|
FlowableSwitchUserHandler() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
Authentication |
buildRunAs(Authentication authentication,
Object object,
Collection<ConfigAttribute> attributes) |
protected void |
cancelCookie(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected String |
getCookiePath(javax.servlet.http.HttpServletRequest request) |
protected boolean |
isAllowedToImpersonateUser(Authentication authentication) |
void |
logout(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Authentication authentication) |
Collection<? extends GrantedAuthority> |
modifyGrantedAuthorities(UserDetails targetUser,
Authentication currentAuthentication,
Collection<? extends GrantedAuthority> authoritiesToBeGranted) |
void |
onAuthenticationFailure(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
AuthenticationException exception) |
void |
onAuthenticationSuccess(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Authentication authentication) |
protected void |
setCookie(String cookieValue,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected void |
setCookie(String cookieValue,
int maxAge,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
void |
setCookieDomain(String cookieDomain) |
void |
setCookieMaxAge(Duration duration) |
void |
setCookieName(String cookieName) |
void |
setImpersonatePermissionVoters(Collection<ImpersonatePermissionVoter> impersonatePermissionVoters) |
void |
setKey(String key) |
void |
setUserDetailsService(UserDetailsService userDetailsService) |
boolean |
supports(Class<?> clazz) |
boolean |
supports(ConfigAttribute attribute) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onAuthenticationSuccess
protected String key
protected String cookieName
protected int cookieMaxAgeInSeconds
protected String cookieDomain
protected UserDetailsService userDetailsService
protected Collection<ImpersonatePermissionVoter> impersonatePermissionVoters
public void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
public void onAuthenticationFailure(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthenticationException exception)
onAuthenticationFailure
in interface AuthenticationFailureHandler
public void onAuthenticationSuccess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Authentication authentication)
onAuthenticationSuccess
in interface AuthenticationSuccessHandler
public void logout(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Authentication authentication)
logout
in interface LogoutHandler
public Authentication buildRunAs(Authentication authentication, Object object, Collection<ConfigAttribute> attributes)
buildRunAs
in interface RunAsManager
public boolean supports(ConfigAttribute attribute)
supports
in interface RunAsManager
public boolean supports(Class<?> clazz)
supports
in interface RunAsManager
public Collection<? extends GrantedAuthority> modifyGrantedAuthorities(UserDetails targetUser, Authentication currentAuthentication, Collection<? extends GrantedAuthority> authoritiesToBeGranted)
modifyGrantedAuthorities
in interface SwitchUserAuthorityChanger
protected boolean isAllowedToImpersonateUser(Authentication authentication)
protected void cancelCookie(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected void setCookie(String cookieValue, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected void setCookie(String cookieValue, int maxAge, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected String getCookiePath(javax.servlet.http.HttpServletRequest request)
public void setKey(String key)
public void setCookieName(String cookieName)
public void setCookieMaxAge(Duration duration)
public void setCookieDomain(String cookieDomain)
public void setUserDetailsService(UserDetailsService userDetailsService)
public void setImpersonatePermissionVoters(Collection<ImpersonatePermissionVoter> impersonatePermissionVoters)