Skip to content

NimbusReactiveJwtDecoder should accept a custom processor #5937

Closed
@jzheaux

Description

@jzheaux

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();

Metadata

Metadata

Assignees

Labels

in: oauth2An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions