Class FlowableSwitchUserHandler
java.lang.Object
com.flowable.core.spring.security.switchuser.FlowableSwitchUserHandler
- All Implemented Interfaces:
InitializingBean
,AuthenticationFailureHandler
,AuthenticationSuccessHandler
,LogoutHandler
,SwitchUserAuthorityChanger
public class FlowableSwitchUserHandler
extends Object
implements AuthenticationSuccessHandler, AuthenticationFailureHandler, LogoutHandler, SwitchUserAuthorityChanger, InitializingBean
- Author:
- Filip Hrisafov
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
protected int
protected String
protected Collection<ImpersonatePermissionVoter>
protected String
protected UserDetailsService
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
buildRunAs
(Authentication authentication, jakarta.servlet.http.HttpServletRequest httpRequest) protected void
cancelCookie
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) protected String
getCookiePath
(jakarta.servlet.http.HttpServletRequest request) protected Authentication
getOriginalAuthentication
(Authentication authentication) protected boolean
isAllowedToImpersonateUser
(Authentication authentication, UserDetails targetUser) void
logout
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Authentication authentication) Collection<? extends GrantedAuthority>
modifyGrantedAuthorities
(UserDetails targetUser, Authentication currentAuthentication, Collection<? extends GrantedAuthority> authoritiesToBeGranted) void
onAuthenticationFailure
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, AuthenticationException exception) void
onAuthenticationSuccess
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Authentication authentication) protected void
setCookie
(String cookieValue, int maxAge, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) protected void
setCookie
(String cookieValue, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) void
setCookieDomain
(String cookieDomain) void
setCookieMaxAge
(Duration duration) void
setCookieName
(String cookieName) void
setImpersonatePermissionVoters
(Collection<ImpersonatePermissionVoter> impersonatePermissionVoters) void
void
setUserDetailsService
(UserDetailsService userDetailsService) 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 Details
-
key
-
cookieName
-
cookieMaxAgeInSeconds
protected int cookieMaxAgeInSeconds -
cookieDomain
-
userDetailsService
-
impersonatePermissionVoters
-
-
Constructor Details
-
FlowableSwitchUserHandler
public FlowableSwitchUserHandler()
-
-
Method Details
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceInitializingBean
-
onAuthenticationFailure
public void onAuthenticationFailure(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, AuthenticationException exception) - Specified by:
onAuthenticationFailure
in interfaceAuthenticationFailureHandler
-
onAuthenticationSuccess
public void onAuthenticationSuccess(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Authentication authentication) - Specified by:
onAuthenticationSuccess
in interfaceAuthenticationSuccessHandler
-
getOriginalAuthentication
-
logout
public void logout(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Authentication authentication) - Specified by:
logout
in interfaceLogoutHandler
-
buildRunAs
public Authentication buildRunAs(Authentication authentication, jakarta.servlet.http.HttpServletRequest httpRequest) -
modifyGrantedAuthorities
public Collection<? extends GrantedAuthority> modifyGrantedAuthorities(UserDetails targetUser, Authentication currentAuthentication, Collection<? extends GrantedAuthority> authoritiesToBeGranted) - Specified by:
modifyGrantedAuthorities
in interfaceSwitchUserAuthorityChanger
-
isAllowedToImpersonateUser
-
cancelCookie
protected void cancelCookie(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) -
setCookie
protected void setCookie(String cookieValue, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) -
setCookie
protected void setCookie(String cookieValue, int maxAge, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) -
getCookiePath
-
setKey
-
setCookieName
-
setCookieMaxAge
-
setCookieDomain
-
setUserDetailsService
-
setImpersonatePermissionVoters
public void setImpersonatePermissionVoters(Collection<ImpersonatePermissionVoter> impersonatePermissionVoters)
-