Skip to content

Add AutoConfiguration support for spring-security-oauth2-resource-server #13787

@jzheaux

Description

@jzheaux

Spring Boot should add auto configuration support for spring-security-oauth2-resource-server. This will allow simplifying how an OAuth 2.0 Resource Server is configured.

For example, a user could configure a resource server in the following way:

spring:
  security:
    oauth2:
      resource-server:
        jwt:
          jwk-set-uri: https://example.org/.well-known/jwks.json

Then, if spring-security-oauth2-resource-server is present on the classpath, as attested by the presence of org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken, Spring Boot's auto configuration support could configure a resource server in the following way:

http
    .authorizeRequests()
        .anyRequest().authenticated()
        .and()
    .oauth2()
        .resourceServer()
            .jwt();

And then could expose an instance of org.springframework.security.oauth2.jwt.NimbusJwtDecoderJwkSupport(jwkSetUri).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions