Class AuthenticationLogoutHandler
java.lang.Object
com.broadleafcommerce.auth.user.web.logout.AuthenticationLogoutHandler
- All Implemented Interfaces:
org.springframework.security.web.authentication.logout.LogoutHandler
public class AuthenticationLogoutHandler
extends Object
implements org.springframework.security.web.authentication.logout.LogoutHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AuthorizedClient
findClient
(String clientId) protected AuthorizationServer
findServer
(AuthorizedClient client) protected AuthorizationServerService<AuthorizationServer>
protected AuthorizedClientService<AuthorizedClient>
protected RememberMeLogoutHandlerDelegate
protected StatelessUtil
protected String
getStringClaim
(String claimName, Map<String, Object> claims) void
logout
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication) protected void
revokeOAuth2AuthorizedClientIfApplicable
(Map<String, Object> existingSessionCookieClaims, AuthorizedClient authorizedClient, AuthorizationServer authorizationServer) Revokes any 3rd Party IDP Login state, if applicable.void
setAuthorizationServerService
(AuthorizationServerService<AuthorizationServer> authorizationServerService) void
setAuthorizedClientService
(AuthorizedClientService<AuthorizedClient> authorizedClientService) void
setOAuth2AuthorizedClientEntityService
(OAuth2AuthorizedClientEntityService<OAuth2AuthorizedClientEntity> oAuth2AuthorizedClientEntityService) void
setRememberMeLogoutHandlerDelegate
(RememberMeLogoutHandlerDelegate rememberMeLogoutHandlerDelegate)
-
Constructor Details
-
AuthenticationLogoutHandler
-
-
Method Details
-
logout
public void logout(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication) - Specified by:
logout
in interfaceorg.springframework.security.web.authentication.logout.LogoutHandler
-
revokeOAuth2AuthorizedClientIfApplicable
protected void revokeOAuth2AuthorizedClientIfApplicable(Map<String, Object> existingSessionCookieClaims, AuthorizedClient authorizedClient, AuthorizationServer authorizationServer) Revokes any 3rd Party IDP Login state, if applicable.We cannot use
OAuth2AuthorizedClientRepository.removeAuthorizedClient(String, Authentication, HttpServletRequest, HttpServletResponse)
, because it typically expects something likeOAuth2LoginAuthenticationToken
as the authentication argument. However, in this logout handler, theAuthentication
we get will be null since the logout filter does not have any security on it.Thus, we invoke
OAuth2AuthorizedClientEntityService
directly with parameters we harvest from other sources.- Parameters:
existingSessionCookieClaims
- a map of claims harvested from the existing Broadleaf session cookieauthorizedClient
- theAuthorizedClient
that this logout is being initiated forauthorizationServer
- theAuthorizationServer
under which theauthorizedClient
exists
-
getStringClaim
-
findClient
-
findServer
-
getSessionUtil
-
setOAuth2AuthorizedClientEntityService
@Autowired public void setOAuth2AuthorizedClientEntityService(OAuth2AuthorizedClientEntityService<OAuth2AuthorizedClientEntity> oAuth2AuthorizedClientEntityService) -
getOAuth2AuthorizedClientEntityService
protected OAuth2AuthorizedClientEntityService<OAuth2AuthorizedClientEntity> getOAuth2AuthorizedClientEntityService() -
setAuthorizedClientService
@Autowired public void setAuthorizedClientService(AuthorizedClientService<AuthorizedClient> authorizedClientService) -
getAuthorizedClientService
-
setAuthorizationServerService
@Autowired public void setAuthorizationServerService(AuthorizationServerService<AuthorizationServer> authorizationServerService) -
getAuthorizationServerService
-
setRememberMeLogoutHandlerDelegate
@Autowired(required=false) public void setRememberMeLogoutHandlerDelegate(RememberMeLogoutHandlerDelegate rememberMeLogoutHandlerDelegate) -
getRememberMeLogoutHandlerDelegate
-