Class FlowableSwitchUserHandler
- java.lang.Object
-
- com.flowable.core.spring.security.switchuser.FlowableSwitchUserHandler
-
- All Implemented Interfaces:
InitializingBean
,RunAsManager
,AuthenticationFailureHandler
,AuthenticationSuccessHandler
,LogoutHandler
,SwitchUserAuthorityChanger
public class FlowableSwitchUserHandler extends Object implements AuthenticationSuccessHandler, AuthenticationFailureHandler, LogoutHandler, RunAsManager, SwitchUserAuthorityChanger, InitializingBean
- Author:
- Filip Hrisafov
-
-
Field Summary
Fields Modifier and Type Field Description protected String
cookieDomain
protected int
cookieMaxAgeInSeconds
protected String
cookieName
protected Collection<ImpersonatePermissionVoter>
impersonatePermissionVoters
protected String
key
protected UserDetailsService
userDetailsService
-
Constructor Summary
Constructors Constructor Description FlowableSwitchUserHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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, int maxAge, 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)
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)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.springframework.security.web.authentication.AuthenticationSuccessHandler
onAuthenticationSuccess
-
-
-
-
Field Detail
-
key
protected String key
-
cookieName
protected String cookieName
-
cookieMaxAgeInSeconds
protected int cookieMaxAgeInSeconds
-
cookieDomain
protected String cookieDomain
-
userDetailsService
protected UserDetailsService userDetailsService
-
impersonatePermissionVoters
protected Collection<ImpersonatePermissionVoter> impersonatePermissionVoters
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSet
in interfaceInitializingBean
-
onAuthenticationFailure
public void onAuthenticationFailure(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthenticationException exception)
- Specified by:
onAuthenticationFailure
in interfaceAuthenticationFailureHandler
-
onAuthenticationSuccess
public void onAuthenticationSuccess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Authentication authentication)
- Specified by:
onAuthenticationSuccess
in interfaceAuthenticationSuccessHandler
-
logout
public void logout(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Authentication authentication)
- Specified by:
logout
in interfaceLogoutHandler
-
buildRunAs
public Authentication buildRunAs(Authentication authentication, Object object, Collection<ConfigAttribute> attributes)
- Specified by:
buildRunAs
in interfaceRunAsManager
-
supports
public boolean supports(ConfigAttribute attribute)
- Specified by:
supports
in interfaceRunAsManager
-
supports
public boolean supports(Class<?> clazz)
- Specified by:
supports
in interfaceRunAsManager
-
modifyGrantedAuthorities
public Collection<? extends GrantedAuthority> modifyGrantedAuthorities(UserDetails targetUser, Authentication currentAuthentication, Collection<? extends GrantedAuthority> authoritiesToBeGranted)
- Specified by:
modifyGrantedAuthorities
in interfaceSwitchUserAuthorityChanger
-
isAllowedToImpersonateUser
protected boolean isAllowedToImpersonateUser(Authentication authentication)
-
cancelCookie
protected void cancelCookie(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
-
setCookie
protected void setCookie(String cookieValue, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
-
setCookie
protected void setCookie(String cookieValue, int maxAge, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
-
getCookiePath
protected String getCookiePath(javax.servlet.http.HttpServletRequest request)
-
setKey
public void setKey(String key)
-
setCookieName
public void setCookieName(String cookieName)
-
setCookieMaxAge
public void setCookieMaxAge(Duration duration)
-
setCookieDomain
public void setCookieDomain(String cookieDomain)
-
setUserDetailsService
public void setUserDetailsService(UserDetailsService userDetailsService)
-
setImpersonatePermissionVoters
public void setImpersonatePermissionVoters(Collection<ImpersonatePermissionVoter> impersonatePermissionVoters)
-
-