Description
The Nimbus JwtDecoders, both servlet and reactive, simplify Nimbus configuration by exposing some basic use cases like using a JWK Set Uri or by using a single public key.
Many scenarios are more complex than this, and Nimbus is a full-featured API that allows users to configure for these more complex scenarios.
#5648 proposes addressing this on the servlet side by introducing a constructor that accepts a JWTProcessor
instance.
Because of certain preprocessing that NimbusJwtReactiveDecoder
does in order to maintain its non-blocking nature as it interacts with Nimbus, it is not yet clear how we might expose the JWTProcessor
there; though coordinating with the Nimbus team may bear some fruit.
UPDATE: Creating a Converter
from scratch that reactively exercises the Nimbus API can be a challenge:
Converter<SignedJWT, Mono<JWTClaimSet>> processor = // ... tricky business
NimbusReactiveJwtDecoder jwtDecoder = new NimbusReactiveJwtDecoder(processor);
So, as part of this ticket, let's also expose a builder for simply working with the keyset:
Function<JWT, Flux<JWK>> jwkSource = // ... reactive way to obtain key set
NimbusReactiveJwtDecoder jwtDecoder =
NimbusReactiveJwtDecoder.withJwkSource(jwkSource).build();