Skip to content

Allow configuring an SSLBundle to use when making JWKS requests #45180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
OrangeDog opened this issue Apr 14, 2025 · 1 comment
Open

Allow configuring an SSLBundle to use when making JWKS requests #45180

OrangeDog opened this issue Apr 14, 2025 · 1 comment
Labels
for: team-meeting An issue we'd like to discuss as a team to make progress status: waiting-for-triage An issue we've not yet triaged

Comments

@OrangeDog
Copy link
Contributor

A Boot application can be configured to make JWKS requests to get the keys with which to verify JWS tokens:

spring.security.oauth2.resourceserver.jwt.jwk-set-uri

However, there is no way to configure the SSL context for these requests.
Adding the standard .ssl.enabled and .ssl.bundle properties would be very useful.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 14, 2025
@wilkinsona
Copy link
Member

However, there is no way to configure the SSL context for these requests.

You can do so by providing a custom RestOperations instance through a JwkSetUriJwtDecoderBuilderCustomizer:

@Bean
JwkSetUriJwtDecoderBuilderCustomizer jwkSetSslCustomizer(SslBundles sslBundles, RestTemplateBuilder restTemplateBuilder) {
    return (builder) -> builder.restOperations(restTemplateBuilder.sslBundle(sslBundles.getBundle("your-bundle")).build());
}

We could consider property support for this, but it would probably require deprecation of jwk-set-uri to group things together. Something like:

spring.security.oauth2.resourceserver.jwt.jwkset.uri
spring.security.oauth2.resourceserver.jwt.jwkset.ssl.bundle
spring.security.oauth2.resourceserver.jwt.jwkset.ssl.enabled

We'll discuss it as a team to see if we think it's worth it.

@wilkinsona wilkinsona added the for: team-meeting An issue we'd like to discuss as a team to make progress label Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: team-meeting An issue we'd like to discuss as a team to make progress status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

3 participants