Class HttpStatusReturningLogoutSuccessHandler
java.lang.Object
org.springframework.security.web.authentication.logout.HttpStatusReturningLogoutSuccessHandler
- All Implemented Interfaces:
LogoutSuccessHandler
Implementation of the
LogoutSuccessHandler. By default returns an HTTP status
code of 200. This is useful in REST-type scenarios where a redirect upon a
successful logout is not desired.- Since:
- 4.0.2
-
Constructor Summary
ConstructorsConstructorDescriptionInitialize theHttpStatusLogoutSuccessHandlerwith the defaultHttpStatus.OK.HttpStatusReturningLogoutSuccessHandler(org.springframework.http.HttpStatus httpStatusToReturn) Initialize theHttpStatusLogoutSuccessHandlerwith a user-definedHttpStatus. -
Method Summary
Modifier and TypeMethodDescriptionvoidonLogoutSuccess(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication)
-
Constructor Details
-
HttpStatusReturningLogoutSuccessHandler
public HttpStatusReturningLogoutSuccessHandler(org.springframework.http.HttpStatus httpStatusToReturn) Initialize theHttpStatusLogoutSuccessHandlerwith a user-definedHttpStatus.- Parameters:
httpStatusToReturn- Must not benull.
-
HttpStatusReturningLogoutSuccessHandler
public HttpStatusReturningLogoutSuccessHandler()Initialize theHttpStatusLogoutSuccessHandlerwith the defaultHttpStatus.OK.
-
-
Method Details
-
onLogoutSuccess
public void onLogoutSuccess(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication) throws IOException Implementation ofLogoutSuccessHandler.onLogoutSuccess(HttpServletRequest, HttpServletResponse, Authentication). Sets the status on theHttpServletResponse.- Specified by:
onLogoutSuccessin interfaceLogoutSuccessHandler- Throws:
IOException
-