Class HttpStatusReturningServerLogoutSuccessHandler
java.lang.Object
org.springframework.security.web.server.authentication.logout.HttpStatusReturningServerLogoutSuccessHandler
- All Implemented Interfaces:
ServerLogoutSuccessHandler
public class HttpStatusReturningServerLogoutSuccessHandler
extends Object
implements ServerLogoutSuccessHandler
Implementation of the
ServerLogoutSuccessHandler
. 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:
- 5.1
-
Constructor Summary
ConstructorDescriptionInitialize theHttpStatusReturningServerLogoutSuccessHandler
with the defaultHttpStatus.OK
.HttpStatusReturningServerLogoutSuccessHandler
(org.springframework.http.HttpStatus httpStatusToReturn) Initialize theHttpStatusReturningServerLogoutSuccessHandler
with a user-definedHttpStatus
. -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Void>
onLogoutSuccess
(WebFilterExchange exchange, Authentication authentication)
-
Constructor Details
-
HttpStatusReturningServerLogoutSuccessHandler
public HttpStatusReturningServerLogoutSuccessHandler(org.springframework.http.HttpStatus httpStatusToReturn) Initialize theHttpStatusReturningServerLogoutSuccessHandler
with a user-definedHttpStatus
.- Parameters:
httpStatusToReturn
- Must not benull
.
-
HttpStatusReturningServerLogoutSuccessHandler
public HttpStatusReturningServerLogoutSuccessHandler()Initialize theHttpStatusReturningServerLogoutSuccessHandler
with the defaultHttpStatus.OK
.
-
-
Method Details
-
onLogoutSuccess
public reactor.core.publisher.Mono<Void> onLogoutSuccess(WebFilterExchange exchange, Authentication authentication) Implementation ofServerLogoutSuccessHandler.onLogoutSuccess(WebFilterExchange, Authentication)
. Sets the status on theWebFilterExchange
.- Specified by:
onLogoutSuccess
in interfaceServerLogoutSuccessHandler
- Parameters:
exchange
- The exchangeauthentication
- TheAuthentication
- Returns:
- A completion notification (success or error)
-