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 StringcookieDomainprotected intcookieMaxAgeInSecondsprotected StringcookieNameprotected Collection<ImpersonatePermissionVoter>impersonatePermissionVotersprotected Stringkeyprotected UserDetailsServiceuserDetailsService
-
Constructor Summary
Constructors Constructor Description FlowableSwitchUserHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()AuthenticationbuildRunAs(Authentication authentication, Object object, Collection<ConfigAttribute> attributes)protected voidcancelCookie(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)protected StringgetCookiePath(javax.servlet.http.HttpServletRequest request)protected AuthenticationgetOriginalAuthentication(Authentication authentication)protected booleanisAllowedToImpersonateUser(Authentication authentication, UserDetails targetUser)voidlogout(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Authentication authentication)Collection<? extends GrantedAuthority>modifyGrantedAuthorities(UserDetails targetUser, Authentication currentAuthentication, Collection<? extends GrantedAuthority> authoritiesToBeGranted)voidonAuthenticationFailure(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthenticationException exception)voidonAuthenticationSuccess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Authentication authentication)protected voidsetCookie(String cookieValue, int maxAge, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)protected voidsetCookie(String cookieValue, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)voidsetCookieDomain(String cookieDomain)voidsetCookieMaxAge(Duration duration)voidsetCookieName(String cookieName)voidsetImpersonatePermissionVoters(Collection<ImpersonatePermissionVoter> impersonatePermissionVoters)voidsetKey(String key)voidsetUserDetailsService(UserDetailsService userDetailsService)booleansupports(Class<?> clazz)booleansupports(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:
afterPropertiesSetin interfaceInitializingBean
-
onAuthenticationFailure
public void onAuthenticationFailure(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthenticationException exception)- Specified by:
onAuthenticationFailurein interfaceAuthenticationFailureHandler
-
onAuthenticationSuccess
public void onAuthenticationSuccess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Authentication authentication)- Specified by:
onAuthenticationSuccessin interfaceAuthenticationSuccessHandler
-
getOriginalAuthentication
protected Authentication getOriginalAuthentication(Authentication authentication)
-
logout
public void logout(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Authentication authentication)- Specified by:
logoutin interfaceLogoutHandler
-
buildRunAs
public Authentication buildRunAs(Authentication authentication, Object object, Collection<ConfigAttribute> attributes)
- Specified by:
buildRunAsin interfaceRunAsManager
-
supports
public boolean supports(ConfigAttribute attribute)
- Specified by:
supportsin interfaceRunAsManager
-
supports
public boolean supports(Class<?> clazz)
- Specified by:
supportsin interfaceRunAsManager
-
modifyGrantedAuthorities
public Collection<? extends GrantedAuthority> modifyGrantedAuthorities(UserDetails targetUser, Authentication currentAuthentication, Collection<? extends GrantedAuthority> authoritiesToBeGranted)
- Specified by:
modifyGrantedAuthoritiesin interfaceSwitchUserAuthorityChanger
-
isAllowedToImpersonateUser
protected boolean isAllowedToImpersonateUser(Authentication authentication, UserDetails targetUser)
-
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)
-
-