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

# Class SecurityContextServerLogoutHandler

java.lang.Object
org.springframework.security.web.server.authentication.logout.SecurityContextServerLogoutHandler

All Implemented Interfaces:
  `ServerLogoutHandler`

public class SecurityContextServerLogoutHandler extends Object implements ServerLogoutHandler
A `ServerLogoutHandler` which removes the SecurityContext using the provided `ServerSecurityContextRepository`

Since:
  5.0

## Constructor Summary

Constructors
Constructor
Description
`SecurityContextServerLogoutHandler()`

## Method Summary

Modifier and Type
Method
Description
`reactor.core.publisher.Mono<Void>`
`logout(WebFilterExchange exchange, org.springframework.security.core.Authentication authentication)`
Invoked when log out is requested
`void`
`setSecurityContextRepository(ServerSecurityContextRepository securityContextRepository)`
Sets the `ServerSecurityContextRepository` that should be used for logging out.

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

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

## Constructor Details

### SecurityContextServerLogoutHandler

public SecurityContextServerLogoutHandler()

## Method Details

### logout

public reactor.core.publisher.Mono<Void> logout(WebFilterExchange exchange, org.springframework.security.core.Authentication authentication)
Description copied from interface: `ServerLogoutHandler`
Invoked when log out is requested

Specified by:
  `logout` in interface `ServerLogoutHandler`
Parameters:
  `exchange` - the exchange
  `authentication` - the `Authentication`
Returns:
  a completion notification (success or error)

### setSecurityContextRepository

public void setSecurityContextRepository(ServerSecurityContextRepository securityContextRepository)
Sets the `ServerSecurityContextRepository` that should be used for logging out. Default is `WebSessionServerSecurityContextRepository`

Parameters:
  `securityContextRepository` - the `ServerSecurityContextRepository` to use.