Package org.springframework.security.web.server.authentication.logout

# 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

Constructors
Constructor
Description
`HttpStatusReturningServerLogoutSuccessHandler()`
Initialize the `HttpStatusReturningServerLogoutSuccessHandler` with the default `HttpStatus.OK`.
`HttpStatusReturningServerLogoutSuccessHandler(org.springframework.http.HttpStatus httpStatusToReturn)`
Initialize the `HttpStatusReturningServerLogoutSuccessHandler` with a user-defined `HttpStatus`.

## Method Summary

Modifier and Type
Method
Description
`reactor.core.publisher.Mono<Void>`
`onLogoutSuccess(WebFilterExchange exchange, org.springframework.security.core.Authentication authentication)`
Implementation of `ServerLogoutSuccessHandler.onLogoutSuccess(WebFilterExchange, Authentication)`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### HttpStatusReturningServerLogoutSuccessHandler

public HttpStatusReturningServerLogoutSuccessHandler(org.springframework.http.HttpStatus httpStatusToReturn)
Initialize the `HttpStatusReturningServerLogoutSuccessHandler` with a user-defined `HttpStatus`.

Parameters:
  `httpStatusToReturn` - Must not be `null`.

### HttpStatusReturningServerLogoutSuccessHandler

public HttpStatusReturningServerLogoutSuccessHandler()
Initialize the `HttpStatusReturningServerLogoutSuccessHandler` with the default `HttpStatus.OK`.

## Method Details

### onLogoutSuccess

public reactor.core.publisher.Mono<Void> onLogoutSuccess(WebFilterExchange exchange, org.springframework.security.core.Authentication authentication)
Implementation of `ServerLogoutSuccessHandler.onLogoutSuccess(WebFilterExchange, Authentication)`. Sets the status on the `WebFilterExchange`.

Specified by:
  `onLogoutSuccess` in interface `ServerLogoutSuccessHandler`
Parameters:
  `exchange` - The exchange
  `authentication` - The `Authentication`
Returns:
  A completion notification (success or error)