Class LogoutServlet
- All Implemented Interfaces:
Servlet,ServletConfig,Serializable
The post-logout redirection is conditioned to configuration of a POST_LOGOUT_REDIRECT_PATH init parameter. This should be a public page, otherwise the user will
directly be sent back to the OpenID Provider for signing in again, and it should be properly
registered at the OpenID Provider in the post_logout_redirect_uris client metadata.
If this post-logout redirect path is a LogoutCallbackServlet, this should be indicated
with a USE_LOGOUT_STATE init parameter with the value true. The final redirect
target will have to be sent as a Utils.RETURN_TO_PARAMETER_NAME form parameter. It should
be given as an absolute path (possibly with a query string), though a full URL would be accepted
as long as it's the same origin.
- See Also:
-
Field Summary
FieldsFields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD -
Constructor Summary
ConstructorsConstructorDescriptionLogoutServlet(String postLogoutRedirectPath) Constructs a logout servlet with the given post-logout redirect path.LogoutServlet(String postLogoutRedirectPath, boolean useLogoutState) Constructs a logout servlet with the given post-logout redirect path and whether to use logout state. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoPost(HttpServletRequest req, HttpServletResponse resp) voidinit()Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, init, service, serviceMethods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, log
-
Field Details
-
POST_LOGOUT_REDIRECT_PATH
- See Also:
-
USE_LOGOUT_STATE
- See Also:
-
-
Constructor Details
-
LogoutServlet
public LogoutServlet() -
LogoutServlet
Constructs a logout servlet with the given post-logout redirect path.When this constructor is used, logout state won't be used, and the init parameters won't be read.
This is equivalent to
new LogoutServlet(postLogoutRedirectPath, false). -
LogoutServlet
Constructs a logout servlet with the given post-logout redirect path and whether to use logout state.When this constructor is used, the init parameters won't be read.
-
-
Method Details
-
init
- Overrides:
initin classGenericServlet- Throws:
ServletException
-
doPost
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException - Overrides:
doPostin classHttpServlet- Throws:
ServletExceptionIOException
-