It would be nice to be able to specify validators, converters, etc. without needing to downcast to the implementation.

Current Behavior

To configure any of these, I first use a factory method, and then I need to downcast to NimbusJwtDecoder to call its setters:

JwtDecoder decoder = JwtDecoders.fromOidcIssuerLocation(issuer);
((NimbusJwtDecoder) decoder).setJwtValidator(validator);
...

Expected Behavior

For now, this ticket is just to get the conversation started. But something like JwtDecoderBuilder might be nice:

JwtDecoder decoder = JwtDecoders
    .withOidcIssuerLocation(issuer).jwtValidator(validator).build();

Comment From: izeye

This seems to be resolved via d28e32b00041bc54811fa47e881895c61bcefd9f.

Comment From: jzheaux

@izeye https://github.com/spring-projects/spring-security/commit/d28e32b00041bc54811fa47e881895c61bcefd9f is a good starting point for this but is ultimately focused on NimbusJwtDecoder. This task is about adding more versatility to JwtDecoders.

That commit may ultimately inform how we complete this ticket, though, which is why it references this issue.

Comment From: izeye

@jzheaux Ah, sorry for the noise. I just thought so with the referenced issue number in the commit.

Comment From: jzheaux

@izeye no worries! Your help is always appreciated.

Comment From: jzheaux

Closed in favor of https://github.com/spring-projects/spring-security/issues/8412