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

# Class ServerHttpSecurity.OAuth2ResourceServerSpec

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

Enclosing class:
  ServerHttpSecurity

public class ServerHttpSecurity.OAuth2ResourceServerSpec extends Object
Configures OAuth2 Resource Server Support

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`class`
`ServerHttpSecurity.OAuth2ResourceServerSpec.JwtSpec`
Configures JWT Resource Server Support
`final class`
`ServerHttpSecurity.OAuth2ResourceServerSpec.OpaqueTokenSpec`
Configures Opaque Token Resource Server support

## Constructor Summary

Constructors
Constructor
Description
`OAuth2ResourceServerSpec()`

## Method Summary

Modifier and Type
Method
Description
`ServerHttpSecurity.OAuth2ResourceServerSpec`
`accessDeniedHandler(org.springframework.security.web.server.authorization.ServerAccessDeniedHandler accessDeniedHandler)`
Configures the `ServerAccessDeniedHandler` to use for requests authenticating with Bearer Tokens.
`ServerHttpSecurity`
`and()`
Deprecated, for removal: This API element is subject to removal in a future version.
For removal in 7.0.
`ServerHttpSecurity.OAuth2ResourceServerSpec`
`authenticationEntryPoint(org.springframework.security.web.server.ServerAuthenticationEntryPoint entryPoint)`
Configures the `ServerAuthenticationEntryPoint` to use for requests authenticating with Bearer Tokens.
`ServerHttpSecurity.OAuth2ResourceServerSpec`
`authenticationFailureHandler(org.springframework.security.web.server.authentication.ServerAuthenticationFailureHandler authenticationFailureHandler)`
`ServerHttpSecurity.OAuth2ResourceServerSpec`
`authenticationManagerResolver(org.springframework.security.authentication.ReactiveAuthenticationManagerResolver<org.springframework.web.server.ServerWebExchange> authenticationManagerResolver)`
Configures the `ReactiveAuthenticationManagerResolver`
`ServerHttpSecurity.OAuth2ResourceServerSpec`
`bearerTokenConverter(org.springframework.security.web.server.authentication.ServerAuthenticationConverter bearerTokenConverter)`
Configures the `ServerAuthenticationConverter` to use for requests authenticating with Bearer Tokens.
`protected void`
`configure(ServerHttpSecurity http)`
`ServerHttpSecurity.OAuth2ResourceServerSpec.JwtSpec`
`jwt()`
Deprecated, for removal: This API element is subject to removal in a future version.
For removal in 7.0.
`ServerHttpSecurity.OAuth2ResourceServerSpec`
`jwt(Customizer<ServerHttpSecurity.OAuth2ResourceServerSpec.JwtSpec> jwtCustomizer)`
Enables JWT Resource Server support.
`ServerHttpSecurity.OAuth2ResourceServerSpec.OpaqueTokenSpec`
`opaqueToken()`
Deprecated, for removal: This API element is subject to removal in a future version.
For removal in 7.0.
`ServerHttpSecurity.OAuth2ResourceServerSpec`
`opaqueToken(Customizer<ServerHttpSecurity.OAuth2ResourceServerSpec.OpaqueTokenSpec> opaqueTokenCustomizer)`
Enables Opaque Token Resource Server support.

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

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

## Constructor Details

### OAuth2ResourceServerSpec

public OAuth2ResourceServerSpec()

## Method Details

### accessDeniedHandler

public ServerHttpSecurity.OAuth2ResourceServerSpec accessDeniedHandler(org.springframework.security.web.server.authorization.ServerAccessDeniedHandler accessDeniedHandler)
Configures the `ServerAccessDeniedHandler` to use for requests authenticating with Bearer Tokens. requests.

Parameters:
  `accessDeniedHandler` - the `ServerAccessDeniedHandler` to use
Returns:
  the `ServerHttpSecurity.OAuth2ResourceServerSpec` for additional configuration
Since:
  5.2

### authenticationEntryPoint

public ServerHttpSecurity.OAuth2ResourceServerSpec authenticationEntryPoint(org.springframework.security.web.server.ServerAuthenticationEntryPoint entryPoint)
Configures the `ServerAuthenticationEntryPoint` to use for requests authenticating with Bearer Tokens.

Parameters:
  `entryPoint` - the `ServerAuthenticationEntryPoint` to use
Returns:
  the `ServerHttpSecurity.OAuth2ResourceServerSpec` for additional configuration
Since:
  5.2

### authenticationFailureHandler

public ServerHttpSecurity.OAuth2ResourceServerSpec authenticationFailureHandler(org.springframework.security.web.server.authentication.ServerAuthenticationFailureHandler authenticationFailureHandler)

### bearerTokenConverter

public ServerHttpSecurity.OAuth2ResourceServerSpec bearerTokenConverter(org.springframework.security.web.server.authentication.ServerAuthenticationConverter bearerTokenConverter)
Configures the `ServerAuthenticationConverter` to use for requests authenticating with Bearer Tokens.

Parameters:
  `bearerTokenConverter` - The `ServerAuthenticationConverter` to use
Returns:
  The `ServerHttpSecurity.OAuth2ResourceServerSpec` for additional configuration
Since:
  5.2

### authenticationManagerResolver

public ServerHttpSecurity.OAuth2ResourceServerSpec authenticationManagerResolver(org.springframework.security.authentication.ReactiveAuthenticationManagerResolver<org.springframework.web.server.ServerWebExchange> authenticationManagerResolver)
Configures the `ReactiveAuthenticationManagerResolver`

Parameters:
  `authenticationManagerResolver` - the `ReactiveAuthenticationManagerResolver`
Returns:
  the `ServerHttpSecurity.OAuth2ResourceServerSpec` for additional configuration
Since:
  5.3

### jwt

@Deprecated(since="6.1", forRemoval=true) public ServerHttpSecurity.OAuth2ResourceServerSpec.JwtSpec jwt()
Deprecated, for removal: This API element is subject to removal in a future version.
For removal in 7.0. Use `jwt(Customizer)` or `jwt(Customizer.withDefaults())` to stick with defaults. See the documentation for more details.
Enables JWT Resource Server support.

Returns:
  the `ServerHttpSecurity.OAuth2ResourceServerSpec.JwtSpec` for additional configuration

### jwt

public ServerHttpSecurity.OAuth2ResourceServerSpec jwt(Customizer<ServerHttpSecurity.OAuth2ResourceServerSpec.JwtSpec> jwtCustomizer)
Enables JWT Resource Server support.

Parameters:
  `jwtCustomizer` - the `Customizer` to provide more options for the `ServerHttpSecurity.OAuth2ResourceServerSpec.JwtSpec`
Returns:
  the `ServerHttpSecurity.OAuth2ResourceServerSpec` to customize

### opaqueToken

@Deprecated(since="6.1", forRemoval=true) public ServerHttpSecurity.OAuth2ResourceServerSpec.OpaqueTokenSpec opaqueToken()
Deprecated, for removal: This API element is subject to removal in a future version.
For removal in 7.0. Use `opaqueToken(Customizer)` or `opaqueToken(Customizer.withDefaults())` to stick with defaults. See the documentation for more details.
Enables Opaque Token Resource Server support.

Returns:
  the `ServerHttpSecurity.OAuth2ResourceServerSpec.OpaqueTokenSpec` for additional configuration

### opaqueToken

public ServerHttpSecurity.OAuth2ResourceServerSpec opaqueToken(Customizer<ServerHttpSecurity.OAuth2ResourceServerSpec.OpaqueTokenSpec> opaqueTokenCustomizer)
Enables Opaque Token Resource Server support.

Parameters:
  `opaqueTokenCustomizer` - the `Customizer` to provide more options for the `ServerHttpSecurity.OAuth2ResourceServerSpec.OpaqueTokenSpec`
Returns:
  the `ServerHttpSecurity.OAuth2ResourceServerSpec` to customize

### configure

protected void configure(ServerHttpSecurity http)

### 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.oauth2ResourceServer(Customizer)` instead