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(WebContext context, SessionStore sessionStore, Config config, HttpActionAdapter httpActionAdapter, String defaultUrl, String inputLogoutUrlPattern, Boolean inputLocalLogout, Boolean inputDestroySession, Boolean inputCentralLogout)
      Description copied from interface: LogoutLogic
      Perform the application logout logic.
      Specified by:
      perform in interface LogoutLogic
      Parameters:
      context - the web context
      sessionStore - the session store
      config - the security configuration
      httpActionAdapter - the HTTP action adapter
      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
      Returns:
      the resulting action for logout
    • enhanceRedirectUrl

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

      public String toString()
      Overrides:
      toString in class Object