Skip to content

JwtDecoders and NimbusJwtDecoder should use the same JWKSource #10312

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

Closed
jzheaux opened this issue Sep 22, 2021 · 0 comments
Closed

JwtDecoders and NimbusJwtDecoder should use the same JWKSource #10312

jzheaux opened this issue Sep 22, 2021 · 0 comments
Assignees
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) type: enhancement A general enhancement
Milestone

Comments

@jzheaux
Copy link
Contributor

jzheaux commented Sep 22, 2021

Related to #9991

JwtDecoders and ReactiveJwtDecoders instantiate a RemoteJWKSet in order to discover reasonable defaults for the JWS algorithms a resource server should accept. NimbusJwtDecoder and NimbusReactiveJwtDecoder 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 the NimbusJwtDecoder. Without this proposed optimization, using SupplierJwtDecoder and JwtDecoders together would mean that the first decode request would experience three HTTP calls instead of two.

@jzheaux jzheaux added type: enhancement A general enhancement in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) labels Sep 22, 2021
@jzheaux jzheaux added this to the 5.6.0-RC1 milestone Sep 22, 2021
@jzheaux jzheaux self-assigned this Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant