-
Notifications
You must be signed in to change notification settings - Fork 6k
Support delegating BearerTokenResolver #14644
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
It also makes sense to make a DelegatingServerAuthenticationConverter for different authentication schemes. What’s interesting is there is no way to change the authorizationPattern in the ServerBearerTokenAuthenticationConverter, which prevents this component from being used for non-standard authentication schemes. |
I think a |
Added DelegatingBearerTokenResolver. I see that DelegatingServerAuthenticationConverter was added in another PR. |
I'm reopening this since there is more to discuss to address the servlet side of this enhancement. |
I don't prefer to add a delegating bearer token resolver as the use case is quite narrow. Instead, I'd prefer to add I realize that @Bean
BearerTokenResolver bearerTokenResolver() {
BearerTokenResolver one = ...;
BearerTokenResolver two = ...;
return (request) -> Optional.ofNullable(one.resolve(request)).orElseGet(() -> two.resolve(request));
} |
Hi @jzheaux. Thanks for your feedback! I added support DelegatingAuthenticationConverter to my PR. |
@jzheaux if the
|
@CrazyParanoid, I think it is worth looking into so long as #9576 is not regressed. Will you please open a separate ticket for now, now that this ticket because the work for adding delegating authentication converters? |
Need to add support for retrieving tokens from different headers in one component. This is a common case when a project has multiple authentication schemes. For example, in ProviderManager there are two providers, but one gets the token through DefaultBearerTokenResolver and the other from a non-standard header like -X-Authorization.
For example, component DelegatingBearerTokenResolver:
The text was updated successfully, but these errors were encountered: