Class DefaultLogoutLogic<R,​C extends WebContext>

  • All Implemented Interfaces:
    LogoutLogic<R,​C>

    public class DefaultLogoutLogic<R,​C extends WebContext>
    extends AbstractExceptionAwareLogic<R,​C>
    implements LogoutLogic<R,​C>

    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
    • Constructor Detail

      • DefaultLogoutLogic

        public DefaultLogoutLogic()
    • Method Detail

      • perform

        public R perform​(C context,
                         Config config,
                         HttpActionAdapter<R,​C> 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<R,​C extends WebContext>
        Parameters:
        context - the web context
        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