Class DefaultLogoutLogic

All Implemented Interfaces:
LogoutLogic

public class DefaultLogoutLogic extends AbstractExceptionAwareLogic implements LogoutLogic

Default logout logic:

If the localLogout property is true, the pac4j profiles are removed from the web session (and the web session is destroyed if the destroySession property is true).

A post logout action is computed as the redirection to the url request parameter if it matches the logoutUrlPattern or to the defaultUrl if it is defined or as a blank page otherwise.

If the centralLogout property is true, the user is redirected to the identity provider for a central logout and then optionally to the post logout redirection URL (if it's supported by the identity provider and if it's an absolute URL). If no central logout is defined, the post logout action is performed directly.

Since:
1.9.0
Author:
Jerome Leleu
  • Field Details

  • Constructor Details

    • DefaultLogoutLogic

      public DefaultLogoutLogic()
  • Method Details

    • perform

      public Object perform(Config config, String defaultUrl, String inputLogoutUrlPattern, Boolean inputLocalLogout, Boolean inputDestroySession, Boolean inputCentralLogout, FrameworkParameters parameters)
      Description copied from interface: LogoutLogic
      Perform the application logout logic.
      Specified by:
      perform in interface LogoutLogic
      Parameters:
      config - the security configuration
      defaultUrl - the default url
      inputLogoutUrlPattern - the logout url pattern
      inputLocalLogout - whether a local logout is required
      inputDestroySession - whether the web session must be destroyed
      inputCentralLogout - whether a central logout is required
      parameters - framework parameters
      Returns:
      the resulting action for logout
    • enhanceRedirectUrl

      protected String enhanceRedirectUrl(Config config, Client client, WebContext context, SessionStore sessionStore, String redirectUrl)