-
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
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.
The following parameters are available:
-
defaultUrl
(optional): the default logout url if nourl
request parameter is provided or if theurl
does not match thelogoutUrlPattern
(not defined by default) -
logoutUrlPattern
(optional): the logout url pattern that theurl
parameter must match (only relative urls are allowed by default) -
localLogout
(optional): whether a local logout must be performed (true
by default) -
destroySession
(optional): whether we must destroy the web session during the local logout (false
by default) -
centralLogout
(optional): whether a central logout must be performed (false
by default).
Example:
get("/logout", new LogoutRoute(config, "/?defaulturlafterlogout"));