Class FlowableSwitchUserHandler
java.lang.Object
com.flowable.core.spring.security.switchuser.FlowableSwitchUserHandler
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
,org.springframework.security.access.intercept.RunAsManager
,org.springframework.security.web.authentication.AuthenticationFailureHandler
,org.springframework.security.web.authentication.AuthenticationSuccessHandler
,org.springframework.security.web.authentication.logout.LogoutHandler
,org.springframework.security.web.authentication.switchuser.SwitchUserAuthorityChanger
public class FlowableSwitchUserHandler
extends java.lang.Object
implements org.springframework.security.web.authentication.AuthenticationSuccessHandler, org.springframework.security.web.authentication.AuthenticationFailureHandler, org.springframework.security.web.authentication.logout.LogoutHandler, org.springframework.security.access.intercept.RunAsManager, org.springframework.security.web.authentication.switchuser.SwitchUserAuthorityChanger, org.springframework.beans.factory.InitializingBean
- Author:
- Filip Hrisafov
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
cookieDomain
protected int
cookieMaxAgeInSeconds
protected java.lang.String
cookieName
protected java.util.Collection<ImpersonatePermissionVoter>
impersonatePermissionVoters
protected java.lang.String
key
protected org.springframework.security.core.userdetails.UserDetailsService
userDetailsService
-
Constructor Summary
Constructors Constructor Description FlowableSwitchUserHandler()
-
Method Summary
Modifier and Type Method Description void
afterPropertiesSet()
org.springframework.security.core.Authentication
buildRunAs(org.springframework.security.core.Authentication authentication, java.lang.Object object, java.util.Collection<org.springframework.security.access.ConfigAttribute> attributes)
protected void
cancelCookie(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected java.lang.String
getCookiePath(javax.servlet.http.HttpServletRequest request)
protected boolean
isAllowedToImpersonateUser(org.springframework.security.core.Authentication authentication)
void
logout(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication)
java.util.Collection<? extends org.springframework.security.core.GrantedAuthority>
modifyGrantedAuthorities(org.springframework.security.core.userdetails.UserDetails targetUser, org.springframework.security.core.Authentication currentAuthentication, java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> authoritiesToBeGranted)
void
onAuthenticationFailure(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException exception)
void
onAuthenticationSuccess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication)
protected void
setCookie(java.lang.String cookieValue, int maxAge, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected void
setCookie(java.lang.String cookieValue, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
void
setCookieDomain(java.lang.String cookieDomain)
void
setCookieMaxAge(java.time.Duration duration)
void
setCookieName(java.lang.String cookieName)
void
setImpersonatePermissionVoters(java.util.Collection<ImpersonatePermissionVoter> impersonatePermissionVoters)
void
setKey(java.lang.String key)
void
setUserDetailsService(org.springframework.security.core.userdetails.UserDetailsService userDetailsService)
boolean
supports(java.lang.Class<?> clazz)
boolean
supports(org.springframework.security.access.ConfigAttribute attribute)
-
Field Details
-
key
protected java.lang.String key -
cookieName
protected java.lang.String cookieName -
cookieMaxAgeInSeconds
protected int cookieMaxAgeInSeconds -
cookieDomain
protected java.lang.String cookieDomain -
userDetailsService
protected org.springframework.security.core.userdetails.UserDetailsService userDetailsService -
impersonatePermissionVoters
-
-
Constructor Details
-
FlowableSwitchUserHandler
public FlowableSwitchUserHandler()
-
-
Method Details
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
onAuthenticationFailure
public void onAuthenticationFailure(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException exception)- Specified by:
onAuthenticationFailure
in interfaceorg.springframework.security.web.authentication.AuthenticationFailureHandler
-
onAuthenticationSuccess
public void onAuthenticationSuccess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication)- Specified by:
onAuthenticationSuccess
in interfaceorg.springframework.security.web.authentication.AuthenticationSuccessHandler
-
logout
public void logout(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication)- Specified by:
logout
in interfaceorg.springframework.security.web.authentication.logout.LogoutHandler
-
buildRunAs
public org.springframework.security.core.Authentication buildRunAs(org.springframework.security.core.Authentication authentication, java.lang.Object object, java.util.Collection<org.springframework.security.access.ConfigAttribute> attributes)- Specified by:
buildRunAs
in interfaceorg.springframework.security.access.intercept.RunAsManager
-
supports
public boolean supports(org.springframework.security.access.ConfigAttribute attribute)- Specified by:
supports
in interfaceorg.springframework.security.access.intercept.RunAsManager
-
supports
public boolean supports(java.lang.Class<?> clazz)- Specified by:
supports
in interfaceorg.springframework.security.access.intercept.RunAsManager
-
modifyGrantedAuthorities
public java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> modifyGrantedAuthorities(org.springframework.security.core.userdetails.UserDetails targetUser, org.springframework.security.core.Authentication currentAuthentication, java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> authoritiesToBeGranted)- Specified by:
modifyGrantedAuthorities
in interfaceorg.springframework.security.web.authentication.switchuser.SwitchUserAuthorityChanger
-
isAllowedToImpersonateUser
protected boolean isAllowedToImpersonateUser(org.springframework.security.core.Authentication authentication) -
cancelCookie
protected void cancelCookie(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) -
setCookie
protected void setCookie(java.lang.String cookieValue, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) -
setCookie
protected void setCookie(java.lang.String cookieValue, int maxAge, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) -
getCookiePath
protected java.lang.String getCookiePath(javax.servlet.http.HttpServletRequest request) -
setKey
public void setKey(java.lang.String key) -
setCookieName
public void setCookieName(java.lang.String cookieName) -
setCookieMaxAge
public void setCookieMaxAge(java.time.Duration duration) -
setCookieDomain
public void setCookieDomain(java.lang.String cookieDomain) -
setUserDetailsService
public void setUserDetailsService(org.springframework.security.core.userdetails.UserDetailsService userDetailsService) -
setImpersonatePermissionVoters
public void setImpersonatePermissionVoters(java.util.Collection<ImpersonatePermissionVoter> impersonatePermissionVoters)
-