-
Notifications
You must be signed in to change notification settings - Fork 41
Logout configuration
The LogoutFilter can handle:
- the local logout by removing the pac4j profiles from the session (it can be used for the front-channel logout from the identity provider in case of a central logout)
- the central logout by calling the identity provider logout endpoint.
It has the following behaviour:
-
If the
localLogoutproperty istrue, the pac4j profiles are removed from the web session (and the web session is destroyed if thedestroySessionproperty istrue) -
A post logout action is computed as the redirection to the
urlrequest parameter if it matches thelogoutUrlPatternor to thedefaultUrlif it is defined or as a blank page otherwise -
If the
centralLogoutproperty 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.
The following parameters are available:
-
defaultUrl(optional): the default logout url if nourlrequest parameter is provided or if theurldoes not match thelogoutUrlPattern(not defined by default) -
logoutUrlPattern(optional): the logout url pattern that theurlparameter must match (only relative urls are allowed by default) -
localLogout(optional): whether a local logout must be performed (trueby default) -
destroySession(optional): whether we must destroy the web session during the local logout (falseby default) -
centralLogout(optional): whether a central logout must be performed (falseby default).
Example:
get("/logout", new LogoutRoute(config, "/?defaulturlafterlogout"));