-
Notifications
You must be signed in to change notification settings - Fork 20
Logout configuration
You can log out the current authenticated user using the LogoutFilter
. It has the following behaviour:
-
after logout, the user is redirected to the url defined by the
url
request parameter if it matches thelogoutUrlPattern
-
or the user is redirected to the
defaultUrl
if it is defined -
otherwise, a blank page is displayed.
In order to bind the filter to an URL, it must be bound to a JAX-RS Resource method using the @Pac4JLogout
annotation.
For example:
@DELETE
@Path("/session")
@Pac4JLogout(skipResponse = true)
public void logout() {
// do nothing
}
-
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). -
skipResponse
(optional): by default pac4j builds an answer (to redirect to the logout url), if this is set totrue
then the response will be skipped. In the case of RESTful APIs, it can make sense to not use redirection.