JwtDecoders and ReactiveJwtDecoders should determine algorithm from JWK Set Endpoint #7160
Labels
in: oauth2
An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)
type: enhancement
A general enhancement
Milestone
JwtDecoder
andReactiveJwtDecoder
could be improved by determining the JWS algorithm from the JWK Set endpoint.This is something already supported in Nimbus via:
The result would be that on startup, the application would hit the JWK Set endpoint, inspect the
kty
field of the JWKs returned, and infer the algorithm or algorithms that the decoder should support accordingly. Perhaps this could be delayed, though, until the first request comes in.If an application wants to skip this auto-configuration, it can easily do so by specifying using
NimbusJwtDecoder
directly:Care will need to be taken to ensure that this change is passive. For example,
NimbusJwtDecoder
selectsRS256
by default. For those still picking the defaults, it'd be unfortunate if the algorithms selected by reading the JWKS response didn't includeRS256
.The text was updated successfully, but these errors were encountered: