JwtDecoders and NimbusJwtDecoder should use the same JWKSource #10312
Labels
in: oauth2
An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)
type: enhancement
A general enhancement
Milestone
Related to #9991
JwtDecoders
andReactiveJwtDecoders
instantiate aRemoteJWKSet
in order to discover reasonable defaults for the JWS algorithms a resource server should accept.NimbusJwtDecoder
andNimbusReactiveJwtDecoder
both instantiate a JWK source as well in order to collect the keys needed to verify JWT signatures.It would be nice if these shared the same instance. If so, then once
JwtDecoders
makes a query for the JWK Set, it's already cached for future decode requests.This is especially nice with the introduction of
SupplierJwtDecoder
, which lazily loads theNimbusJwtDecoder
. Without this proposed optimization, usingSupplierJwtDecoder
andJwtDecoders
together would mean that the first decode request would experience three HTTP calls instead of two.The text was updated successfully, but these errors were encountered: