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
FieldsModifier and TypeFieldDescriptionprotected Stringprotected intprotected Stringprotected Collection<ImpersonatePermissionVoter>protected Stringprotected UserDetailsService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildRunAs(Authentication authentication, jakarta.servlet.http.HttpServletRequest httpRequest) protected voidcancelCookie(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) protected StringgetCookiePath(jakarta.servlet.http.HttpServletRequest request) protected AuthenticationgetOriginalAuthentication(Authentication authentication) protected booleanisAllowedToImpersonateUser(Authentication authentication, UserDetails targetUser) voidlogout(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Authentication authentication) Collection<? extends GrantedAuthority>modifyGrantedAuthorities(UserDetails targetUser, Authentication currentAuthentication, Collection<? extends GrantedAuthority> authoritiesToBeGranted) voidonAuthenticationFailure(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, AuthenticationException exception) voidonAuthenticationSuccess(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Authentication authentication) protected voidsetCookie(String cookieValue, int maxAge, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) protected voidsetCookie(String cookieValue, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) voidsetCookieDomain(String cookieDomain) voidsetCookieMaxAge(Duration duration) voidsetCookieName(String cookieName) voidsetImpersonatePermissionVoters(Collection<ImpersonatePermissionVoter> impersonatePermissionVoters) voidvoidsetUserDetailsService(UserDetailsService userDetailsService) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
afterPropertiesSetin interfaceInitializingBean
-
onAuthenticationFailure
public void onAuthenticationFailure(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, AuthenticationException exception) - Specified by:
onAuthenticationFailurein interfaceAuthenticationFailureHandler
-
onAuthenticationSuccess
public void onAuthenticationSuccess(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Authentication authentication) - Specified by:
onAuthenticationSuccessin interfaceAuthenticationSuccessHandler
-
getOriginalAuthentication
-
logout
public void logout(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Authentication authentication) - Specified by:
logoutin 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:
modifyGrantedAuthoritiesin 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)
-