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
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 Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
enhanceRedirectUrl
(Config config, Client client, WebContext context, SessionStore sessionStore, String redirectUrl) perform
(WebContext context, SessionStore sessionStore, Config config, HttpActionAdapter httpActionAdapter, String defaultUrl, String inputLogoutUrlPattern, Boolean inputLocalLogout, Boolean inputDestroySession, Boolean inputCentralLogout) Perform the application logout logic.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 Details
-
INSTANCE
-
-
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 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
-
enhanceRedirectUrl
protected String enhanceRedirectUrl(Config config, Client client, WebContext context, SessionStore sessionStore, String redirectUrl) -
toString
-