Package org.pac4j.core.engine
Class DefaultLogoutLogic
- java.lang.Object
-
- org.pac4j.core.profile.factory.ProfileManagerFactoryAware
-
- org.pac4j.core.engine.AbstractExceptionAwareLogic
-
- org.pac4j.core.engine.DefaultLogoutLogic
-
- All Implemented Interfaces:
LogoutLogic
public class DefaultLogoutLogic extends AbstractExceptionAwareLogic implements LogoutLogic
Default logout logic:
If the
localLogout
property istrue
, the pac4j profiles are removed from the web session (and the web session is destroyed if thedestroySession
property istrue
).A post logout action is computed as the redirection to the
url
request parameter if it matches thelogoutUrlPattern
or to thedefaultUrl
if it is defined or as a blank page otherwise.If the
centralLogout
property istrue
, 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 Summary
Fields Modifier and Type Field Description static DefaultLogoutLogic
INSTANCE
-
Constructor Summary
Constructors Constructor Description DefaultLogoutLogic()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
perform(WebContext context, SessionStore sessionStore, Config config, HttpActionAdapter httpActionAdapter, java.lang.String defaultUrl, java.lang.String inputLogoutUrlPattern, java.lang.Boolean inputLocalLogout, java.lang.Boolean inputDestroySession, java.lang.Boolean inputCentralLogout)
Perform the application logout logic.java.lang.String
toString()
-
Methods inherited from class org.pac4j.core.engine.AbstractExceptionAwareLogic
getErrorUrl, handleException, runtimeException, setErrorUrl
-
Methods inherited from class org.pac4j.core.profile.factory.ProfileManagerFactoryAware
getProfileManager, getProfileManagerFactory, setProfileManagerFactory
-
-
-
-
Field Detail
-
INSTANCE
public static final DefaultLogoutLogic INSTANCE
-
-
Method Detail
-
perform
public java.lang.Object perform(WebContext context, SessionStore sessionStore, Config config, HttpActionAdapter httpActionAdapter, java.lang.String defaultUrl, java.lang.String inputLogoutUrlPattern, java.lang.Boolean inputLocalLogout, java.lang.Boolean inputDestroySession, java.lang.Boolean inputCentralLogout)
Description copied from interface:LogoutLogic
Perform the application logout logic.- Specified by:
perform
in interfaceLogoutLogic
- Parameters:
context
- the web contextsessionStore
- the session storeconfig
- the security configurationhttpActionAdapter
- the HTTP action adapterdefaultUrl
- the default urlinputLogoutUrlPattern
- the logout url patterninputLocalLogout
- whether a local logout is requiredinputDestroySession
- whether the web session must be destroyedinputCentralLogout
- whether a central logout is required- Returns:
- the resulting action for logout
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-