Package org.springframework.security.web.server.authorization

# Class ServerWebExchangeDelegatingServerAccessDeniedHandler

java.lang.Object
org.springframework.security.web.server.authorization.ServerWebExchangeDelegatingServerAccessDeniedHandler

All Implemented Interfaces:
  `ServerAccessDeniedHandler`

public class ServerWebExchangeDelegatingServerAccessDeniedHandler extends Object implements ServerAccessDeniedHandler
A `ServerAccessDeniedHandler` which delegates to multiple `ServerAccessDeniedHandler`s based on a `ServerWebExchangeMatcher`

Since:
  5.1

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`ServerWebExchangeDelegatingServerAccessDeniedHandler.DelegateEntry`

## Constructor Summary

Constructors
Constructor
Description
`ServerWebExchangeDelegatingServerAccessDeniedHandler(List<ServerWebExchangeDelegatingServerAccessDeniedHandler.DelegateEntry> handlers)`
Creates a new instance
`ServerWebExchangeDelegatingServerAccessDeniedHandler(ServerWebExchangeDelegatingServerAccessDeniedHandler.DelegateEntry... handlers)`
Creates a new instance

## Method Summary

Modifier and Type
Method
Description
`reactor.core.publisher.Mono<Void>`
`handle(org.springframework.web.server.ServerWebExchange exchange, org.springframework.security.access.AccessDeniedException denied)`
`void`
`setDefaultAccessDeniedHandler(ServerAccessDeniedHandler accessDeniedHandler)`
Use this `ServerAccessDeniedHandler` when no `ServerWebExchangeMatcher` matches.

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

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

## Constructor Details

### ServerWebExchangeDelegatingServerAccessDeniedHandler

public ServerWebExchangeDelegatingServerAccessDeniedHandler(ServerWebExchangeDelegatingServerAccessDeniedHandler.DelegateEntry... handlers)
Creates a new instance

Parameters:
  `handlers` - a list of `ServerWebExchangeMatcher`/ `ServerAccessDeniedHandler` pairs that should be used. Each is considered in the order they are specified and only the first `ServerAccessDeniedHandler` is used. If none match, then the default `ServerAccessDeniedHandler` is used.

### ServerWebExchangeDelegatingServerAccessDeniedHandler

public ServerWebExchangeDelegatingServerAccessDeniedHandler(List<ServerWebExchangeDelegatingServerAccessDeniedHandler.DelegateEntry> handlers)
Creates a new instance

Parameters:
  `handlers` - a list of `ServerWebExchangeMatcher`/ `ServerAccessDeniedHandler` pairs that should be used. Each is considered in the order they are specified and only the first `ServerAccessDeniedHandler` is used. If none match, then the default `ServerAccessDeniedHandler` is used.

## Method Details

### handle

public reactor.core.publisher.Mono<Void> handle(org.springframework.web.server.ServerWebExchange exchange, org.springframework.security.access.AccessDeniedException denied)

Specified by:
  `handle` in interface `ServerAccessDeniedHandler`

### setDefaultAccessDeniedHandler

public void setDefaultAccessDeniedHandler(ServerAccessDeniedHandler accessDeniedHandler)
Use this `ServerAccessDeniedHandler` when no `ServerWebExchangeMatcher` matches.

Parameters:
  `accessDeniedHandler` - - the default `ServerAccessDeniedHandler` to use