Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added the ability to pass in a parameter when using JwtIssuerAuthenticationManagerResolver #17748

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

Open
jsight wants to merge 1 commit into spring-projects:main
base: main
Choose a base branch
Loading
from jsight:add_converter_params

Conversation

Copy link

@jsight jsight commented Aug 16, 2025

I ran into this issue earlier today and found it surprisingly difficult to use a converter along with JwtIssuerAuthenticationManagerResolver. This is a proposed PR to make it possible to directly pass in the converter when creating the resolver.

Thoughts?

Copy link
Contributor

jzheaux commented Sep 10, 2025

Hi, @jsight, thanks for the suggestion. I'd prefer to leave the implementation details hidden regarding what authentication provider(s) the resolver chooses to construct, if possible.

Have you already considered the following:

public final class MyIssuerAuthenticationManagerResolver implements AuthenticationManagerResolver<String> {
 private final List<String> issuers;
 
 @Cacheable
 @Override 
 public AuthenticationManager resolve(String issuer) {
 Assert.isTrue(this.issuers.contains(issuer), "untrusted issuer");
 JwtDecoder jwtDecoder = JwtDecoder.fromIssuerLocation(issuer);
 JwtAuthenticationProvider authenticationProvider = new JwtAuthenticationProvider(jwtDecoder);
 JwtAuthenticationConverter converter = // your custom code
 authenticationProvider.setJwtAuthenticationConverter(converter);
 return new ProviderManager(authenticationProvider);
 }
}

and then:

JwtIssuerAuthenticationManagerResolver.fromTrustedIssuers(new MyIssuerAuthenticationManagerResolver());

@jzheaux jzheaux added status: waiting-for-feedback We need additional information before we can continue and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 10, 2025
@jzheaux jzheaux self-assigned this Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Labels
status: waiting-for-feedback We need additional information before we can continue
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /