Class HttpStatusReturningLogoutSuccessHandler
- java.lang.Object
-
- org.springframework.security.web.authentication.logout.HttpStatusReturningLogoutSuccessHandler
-
- All Implemented Interfaces:
LogoutSuccessHandler
public class HttpStatusReturningLogoutSuccessHandler extends java.lang.Object implements LogoutSuccessHandler
Implementation of theLogoutSuccessHandler
. By default returns an HTTP status code of200
. This is useful in REST-type scenarios where a redirect upon a successful logout is not desired.- Since:
- 4.0.2
-
-
Constructor Summary
Constructors Constructor Description HttpStatusReturningLogoutSuccessHandler()
Initialize theHttpStatusLogoutSuccessHandler
with the defaultHttpStatus.OK
.HttpStatusReturningLogoutSuccessHandler(org.springframework.http.HttpStatus httpStatusToReturn)
Initialize theHttpStatusLogoutSuccessHandler
with a user-definedHttpStatus
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onLogoutSuccess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Authentication authentication)
-
-
-
Constructor Detail
-
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 Detail
-
onLogoutSuccess
public void onLogoutSuccess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Authentication authentication) throws java.io.IOException
Implementation ofLogoutSuccessHandler.onLogoutSuccess(HttpServletRequest, HttpServletResponse, Authentication)
. Sets the status on theHttpServletResponse
.- Specified by:
onLogoutSuccess
in interfaceLogoutSuccessHandler
- Throws:
java.io.IOException
-
-