Package org.springframework.security.config.web.server

# Class ServerHttpSecurity.ExceptionHandlingSpec

java.lang.Object
org.springframework.security.config.web.server.ServerHttpSecurity.ExceptionHandlingSpec

Enclosing class:
  ServerHttpSecurity

public final class ServerHttpSecurity.ExceptionHandlingSpec extends Object
Configures exception handling

Since:
  5.0
See Also:
  - `ServerHttpSecurity.exceptionHandling()`

## Method Summary

Modifier and Type
Method
Description
`ServerHttpSecurity.ExceptionHandlingSpec`
`accessDeniedHandler(org.springframework.security.web.server.authorization.ServerAccessDeniedHandler accessDeniedHandler)`
Configures what to do when an authenticated user does not hold a required authority
`ServerHttpSecurity`
`and()`
Deprecated, for removal: This API element is subject to removal in a future version.
For removal in 7.0.
`ServerHttpSecurity.ExceptionHandlingSpec`
`authenticationEntryPoint(org.springframework.security.web.server.ServerAuthenticationEntryPoint authenticationEntryPoint)`
Configures what to do when the application request authentication

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

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

## Method Details

### authenticationEntryPoint

public ServerHttpSecurity.ExceptionHandlingSpec authenticationEntryPoint(org.springframework.security.web.server.ServerAuthenticationEntryPoint authenticationEntryPoint)
Configures what to do when the application request authentication

Parameters:
  `authenticationEntryPoint` - the entry point to use
Returns:
  the `ServerHttpSecurity.ExceptionHandlingSpec` to configure

### accessDeniedHandler

public ServerHttpSecurity.ExceptionHandlingSpec accessDeniedHandler(org.springframework.security.web.server.authorization.ServerAccessDeniedHandler accessDeniedHandler)
Configures what to do when an authenticated user does not hold a required authority

Parameters:
  `accessDeniedHandler` - the access denied handler to use
Returns:
  the `ServerHttpSecurity.ExceptionHandlingSpec` to configure
Since:
  5.0.5

### and

@Deprecated(since="6.1", forRemoval=true) public ServerHttpSecurity and()
Deprecated, for removal: This API element is subject to removal in a future version.
For removal in 7.0. Use `ServerHttpSecurity.exceptionHandling(Customizer)` instead
Allows method chaining to continue configuring the `ServerHttpSecurity`

Returns:
  the `ServerHttpSecurity` to continue configuring