Class SpringAddonsOAuth2LogoutSuccessHandler

java.lang.Object
org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler
org.springframework.security.web.authentication.logout.SimpleUrlLogoutSuccessHandler
com.c4_soft.springaddons.security.oauth2.config.synchronised.SpringAddonsOAuth2LogoutSuccessHandler
All Implemented Interfaces:
org.springframework.security.web.authentication.logout.LogoutSuccessHandler

public class SpringAddonsOAuth2LogoutSuccessHandler extends org.springframework.security.web.authentication.logout.SimpleUrlLogoutSuccessHandler

Provide with RP-Initiated Logout for authorization-servers fully compliant with OIDC standard as well as those "almost" implementing the spec. It is (auto)configured with SpringAddonsOAuth2ClientProperties.

This implementation is not multi-tenant ready. It will terminate the user session on this application as well as on a single authorization-server (the one which emitted the access-token with which the logout request is made).

This bean is auto-configured by SpringAddonsOAuth2ClientBeans as @ConditionalOnMissingBean of type LogoutSuccessHandler. Usage:

 SecurityFilterChain uiFilterChain(HttpSecurity http, LogoutSuccessHandler logoutSuccessHandler) {
        http.logout().logoutSuccessHandler(logoutSuccessHandler);
 }
 
Author:
Jerome Wacongne ch4mp@c4-soft.com
See Also:
  • SpringAddonsOAuth2LogoutRequestUriBuilder
  • SpringAddonsOAuth2ClientProperties
  • Field Summary

    Fields inherited from class org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler

    logger
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
    determineTargetUrl(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication)
     

    Methods inherited from class org.springframework.security.web.authentication.logout.SimpleUrlLogoutSuccessHandler

    onLogoutSuccess

    Methods inherited from class org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler

    determineTargetUrl, getDefaultTargetUrl, getRedirectStrategy, getTargetUrlParameter, handle, isAlwaysUseDefaultTargetUrl, setAlwaysUseDefaultTargetUrl, setDefaultTargetUrl, setRedirectStrategy, setTargetUrlParameter, setUseReferer

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SpringAddonsOAuth2LogoutSuccessHandler

      public SpringAddonsOAuth2LogoutSuccessHandler()
  • Method Details

    • determineTargetUrl

      protected String determineTargetUrl(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication)
      Overrides:
      determineTargetUrl in class org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler