-
Notifications
You must be signed in to change notification settings - Fork 6k
Add ReactiveJwtIssuerAuthenticationManagerResolver and Reactive Multi Tentant Examples #7857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi, @davidmelia, thanks for reaching out about this - I think a reactive version of public Mono<AuthenticationManager> resolve(ServerWebExchange exchange) {
BearerTokenAuthenticationToken bearerToken = (BearerTokenAuthenticationToken)
this.authenticationConverter.convert(exchange);
String token = bearerToken.getToken();
// extract issuer claim
return this.issuerAuthenticationManagerResolver.resolve(exchange);
} Would you be interested in working with me on a PR for As for your question about parsing only once - I'd first recommend assessing how much of your request is actually being spent on parsing the JWT. Because Nimbus doesn't yet have a reactive API, the amount of time and complexity involved in ironing that out is most likely an early optimization. |
@jzheaux I could work on the PR with you. I think one big issue here to your suggestion is that AuthenticationWebFilter requires the following
and therefore we cannot get hold of the ServerWebExchange unless I write a new AuthenticationWebFilter which I don't really want to do. |
Good point, @davidmelia. I believe #7872 will address that. If you agree that such would address your concern, maybe we start with that ticket? Thinking ahead just a bit, it'd be nice to address these tickets before RC1 next week. Do you think you've got time to submit a PR by Friday? If not, no worries, and I can submit the PR and have you review it. |
@jzheaux I won't have time to submit the PR but I would definitely help review your PR by Friday. |
Hi,
I'm trying to add oauth resource server multi tenancy support (by issuer) to my existing webflux stack (Boot 2.2, Spring Security 5.2.1) and am really struggling.
I have a couple of requests:
Could you add a reactive counterpart to Add JwtIssuerAuthenticationManagerResolver #7733
All the examples in https://docs.spring.io/spring-security/site/docs/current/reference/htmlsingle/#oauth2resourceserver-multitenancy are none reactive and I'm really struggling to get reactive to work. I've figured out the below but have had to cut and paste code from ServerBearerTokenAuthenticationConverter which seems wrong:
Ideally I would like to implement a reactive version of https://docs.spring.io/spring-security/site/docs/current/reference/htmlsingle/#parsing-the-claim-only-once but cannot figure out NimbusReactiveJwtDecoder. Could you give me any pointers?
Thanks
The text was updated successfully, but these errors were encountered: