-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Closed
Labels
in: oauth2An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)type: enhancementA general enhancementA general enhancement
Milestone
Description
It would be nice if NimbusJwtDecoderJwkSupport were a bit easier to test. Also, NimbusJwtDecoderJwkSupport is very opinionated in the way that Nimbus gets configured.
We could alleviate both of these by introducing a constructor or separate JwtDecoder implementation entirely that takes a Nimbus JwtProcessor:
public NimbusJwtDecoderJwkSupport(JwtProcessor<SecurityContext> jwtProcessor) {
this.jwtProcessor = jwtProcessor;
}or
public class NimbusJwtDecoder(JwtProcessor<SecurityContext> jwtProcessor) {
this.jwtProcessor = this.jwtProcessor;
}
// and
private NimbusJwtDecoder delegate;
public class NimbusJwtDecoderJwkSupport(String jwkSetUrl) {
JwtProcessor<SecurityContext> jwtProcessor = // .... configure
this.delegate = new NimbusJwtDecoder(jwtProcessor);
}Either of these would make it possible to:
- Write tests that do not depend on a legitimate static Jwt and Jwk Set to be provided, simplifying unit tests
- Provide for easier configuration for users who want to configure Nimbus themselves outside of Spring Security's guidance.
DarrenForsythe and kirankasa
Metadata
Metadata
Assignees
Labels
in: oauth2An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)type: enhancementA general enhancementA general enhancement