Package org.pac4j.core.engine
Class DefaultLogoutLogic<R,C extends WebContext>
- java.lang.Object
-
- org.pac4j.core.profile.factory.ProfileManagerFactoryAware<C>
-
- org.pac4j.core.engine.AbstractExceptionAwareLogic<R,C>
-
- org.pac4j.core.engine.DefaultLogoutLogic<R,C>
-
- 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 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 inherited from class org.pac4j.core.engine.AbstractExceptionAwareLogic
logger
-
-
Constructor Summary
Constructors Constructor Description DefaultLogoutLogic()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description R
perform(C context, Config config, HttpActionAdapter<R,C> httpActionAdapter, String defaultUrl, String inputLogoutUrlPattern, Boolean inputLocalLogout, Boolean inputDestroySession, Boolean inputCentralLogout)
Perform the application logout logic.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
-
-
-
-
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 interfaceLogoutLogic<R,C extends WebContext>
- Parameters:
context
- the web contextconfig
- 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
-
-