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
ConstructorDescriptionInitialize theHttpStatusLogoutSuccessHandler
with the defaultHttpStatus.OK
.HttpStatusReturningLogoutSuccessHandler
(org.springframework.http.HttpStatus httpStatusToReturn) Initialize theHttpStatusLogoutSuccessHandler
with a user-definedHttpStatus
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
onLogoutSuccess
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Authentication authentication)
-
Constructor Details
-
HttpStatusReturningLogoutSuccessHandler
public HttpStatusReturningLogoutSuccessHandler(org.springframework.http.HttpStatus httpStatusToReturn) Initialize theHttpStatusLogoutSuccessHandler
with a user-definedHttpStatus
.- Parameters:
httpStatusToReturn
- Must not benull
.
-
HttpStatusReturningLogoutSuccessHandler
public HttpStatusReturningLogoutSuccessHandler()Initialize theHttpStatusLogoutSuccessHandler
with the defaultHttpStatus.OK
.
-
-
Method Details
-
onLogoutSuccess
public void onLogoutSuccess(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Authentication authentication) throws IOException Implementation ofLogoutSuccessHandler.onLogoutSuccess(HttpServletRequest, HttpServletResponse, Authentication)
. Sets the status on theHttpServletResponse
.- Specified by:
onLogoutSuccess
in interfaceLogoutSuccessHandler
- Throws:
IOException
-