Feature/reactive oauth2 token validator#18506
Conversation
|
You are right, when the I'm actually very surprised that this is coming up just now given that Regardless, it is an issue that could happen. However, instead of introducing a new API, this can be solved quite easily by wrapping the validation in This would be the preference over introducing a new API and associated implementations. |
f91ae7e to
8f73bbd
Compare
…ocess non-reactive JwtValidators on the BoundedElastic scheduler Signed-off-by: Iain Henderson <Iain.henderson@mac.com>
9a23773 to
8a20b22
Compare
…busReactiveJwtDecoder::setJwtValidator Signed-off-by: Iain Henderson <Iain.henderson@mac.com>
|
I think I have cleaned this up. |
| // @formatter:off | ||
| return this.jwtProcessor.convert(parsedToken) | ||
| .map((set) -> createJwt(parsedToken, set)) | ||
| .map(this::validateJwt) |
There was a problem hiding this comment.
I believe the only change required here is to change .map(this::validateJwt) to:
.flatMap((jwt) -> Mono.fromSupplier(() -> validateJwt(jwt)).subscribeOn(Schedulers.boundedElastic()))
All other updates should be reverted.
There was a problem hiding this comment.
Then how would you use a reactive validator?
There was a problem hiding this comment.
I don't understand? The framework does not have/support a reactive validator.
There was a problem hiding this comment.
This PR does support a reactive validator.
OAuth2TokenValidators are currently synchronous only. If a validator has an asynchronous dependency it cannot be used.
This PR updates NimbusReactiveJwtDecoder to utilize ReactiveOAuth2TokenValidator and adds a ReactiveWrappingOAuth2TokenValidator to facilitate using OAuth2TokenValidators in a reactive context.