Class ImpersonationEndpoint
java.lang.Object
com.broadleafcommerce.auth.user.web.endpoint.ImpersonationEndpoint
- Author:
- Nick Crum (ncrum)
-
Field Summary
-
Constructor Summary
ConstructorDescriptionImpersonationEndpoint
(ImpersonationService impersonationService, ImpersonationRequestValidator requestValidator, OAuth2UserDetailsService userDetailsService, StatelessUtil statelessUtil) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addSessionCookie
(jakarta.servlet.http.HttpServletResponse response, ImpersonationRequestToken impersonationRequest, OAuth2UserDetails impersonatedUser) org.springframework.web.servlet.ModelAndView
consumeToken
(jakarta.servlet.http.HttpServletResponse response, String token) protected OAuth2UserDetails
getCsrUser
(String clientId, String csrId) protected String
getCsrUserId
(org.springframework.security.core.Authentication authentication) protected OAuth2UserDetails
getUserToImpersonate
(String clientId, String username) impersonate
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, ImpersonationRequest impersonationRequest, org.springframework.security.core.Authentication authentication) impersonateSelf
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, ImpersonationRequest impersonationRequest, org.springframework.security.core.Authentication authentication) protected OAuth2UserDetails
loadAnonymousCsrUser
(String clientId)
-
Field Details
-
CONSUME_TOKEN_PATH
- See Also:
-
IMPERSONATE_PATH
- See Also:
-
-
Constructor Details
-
ImpersonationEndpoint
public ImpersonationEndpoint(ImpersonationService impersonationService, ImpersonationRequestValidator requestValidator, OAuth2UserDetailsService userDetailsService, StatelessUtil statelessUtil)
-
-
Method Details
-
impersonate
@FrameworkGetMapping("/impersonate") @PreAuthorize("isAuthenticated() and hasAuthority(\'ALL_IMPERSONATE\')") public String impersonate(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, ImpersonationRequest impersonationRequest, org.springframework.security.core.Authentication authentication) -
impersonateSelf
@FrameworkGetMapping(value="/impersonate", params="impersonate_self=true") @PreAuthorize("isAuthenticated() and hasAuthority(\'ALL_IMPERSONATE\')") public String impersonateSelf(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, ImpersonationRequest impersonationRequest, org.springframework.security.core.Authentication authentication) -
consumeToken
@FrameworkGetMapping("/consume-token") public org.springframework.web.servlet.ModelAndView consumeToken(jakarta.servlet.http.HttpServletResponse response, @RequestParam("signedJwt") String token) -
getUserToImpersonate
-
getCsrUser
-
loadAnonymousCsrUser
-
addSessionCookie
protected void addSessionCookie(jakarta.servlet.http.HttpServletResponse response, ImpersonationRequestToken impersonationRequest, OAuth2UserDetails impersonatedUser) -
getCsrUserId
-