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.StringcookieDomainprotected intcookieMaxAgeInSecondsprotected java.lang.StringcookieNameprotected java.util.Collection<ImpersonatePermissionVoter>impersonatePermissionVotersprotected java.lang.Stringkeyprotected org.springframework.security.core.userdetails.UserDetailsServiceuserDetailsService -
Constructor Summary
Constructors Constructor Description FlowableSwitchUserHandler() -
Method Summary
Modifier and Type Method Description voidafterPropertiesSet()org.springframework.security.core.AuthenticationbuildRunAs(org.springframework.security.core.Authentication authentication, java.lang.Object object, java.util.Collection<org.springframework.security.access.ConfigAttribute> attributes)protected voidcancelCookie(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)protected java.lang.StringgetCookiePath(javax.servlet.http.HttpServletRequest request)protected booleanisAllowedToImpersonateUser(org.springframework.security.core.Authentication authentication)voidlogout(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)voidonAuthenticationFailure(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException exception)voidonAuthenticationSuccess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication)protected voidsetCookie(java.lang.String cookieValue, int maxAge, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)protected voidsetCookie(java.lang.String cookieValue, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)voidsetCookieDomain(java.lang.String cookieDomain)voidsetCookieMaxAge(java.time.Duration duration)voidsetCookieName(java.lang.String cookieName)voidsetImpersonatePermissionVoters(java.util.Collection<ImpersonatePermissionVoter> impersonatePermissionVoters)voidsetKey(java.lang.String key)voidsetUserDetailsService(org.springframework.security.core.userdetails.UserDetailsService userDetailsService)booleansupports(java.lang.Class<?> clazz)booleansupports(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:
afterPropertiesSetin 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:
onAuthenticationFailurein 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:
onAuthenticationSuccessin 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:
logoutin 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:
buildRunAsin interfaceorg.springframework.security.access.intercept.RunAsManager
-
supports
public boolean supports(org.springframework.security.access.ConfigAttribute attribute)- Specified by:
supportsin interfaceorg.springframework.security.access.intercept.RunAsManager
-
supports
public boolean supports(java.lang.Class<?> clazz)- Specified by:
supportsin 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:
modifyGrantedAuthoritiesin 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)
-