Skip to content
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

Add client-certificate when fetching client-jwks #1788

Open
edwinrozendom opened this issue Oct 24, 2024 · 1 comment
Open

Add client-certificate when fetching client-jwks #1788

edwinrozendom opened this issue Oct 24, 2024 · 1 comment
Labels
type: enhancement A general enhancement

Comments

@edwinrozendom
Copy link

edwinrozendom commented Oct 24, 2024

Expected Behavior

We would like to add a client-certificate to the outbound request when fetching a JwkSetUrl from a configured client.

Current Behavior

RestTemplate is a static final variable in JwtClientAssertionDecoderFactory.java. It would be nice to expose Resttemplate, in order to configure it with the authorizationServerConfigurer. (same suggestion as in #1413)

The exposed method could be used in the authorizationServerConfigurer.AuthenticationProvider, e.g.

authenticationProviders.forEach((authenticationProvider) -> {
			if (authenticationProvider instanceof JwtClientAssertionAuthenticationProvider) {
				// Customize JwtClientAssertionDecoderFactory
				JwtClientAssertionDecoderFactory jwtDecoderFactory = new JwtClientAssertionDecoderFactory();
                                jwtDecoderFactory.setRestTemplate(...).

}
}

Context

This issue only affects oAuth flows with private_key_jwt client authentication.

I would be able to create a PR if the suggestion of exposing RestTemplate is acceptable!

@edwinrozendom edwinrozendom added the type: enhancement A general enhancement label Oct 24, 2024
@jgrandja
Copy link
Collaborator

@edwinrozendom I'm not sure we want to expose JwtClientAssertionDecoderFactory.setRestTemplate(). I'll need to give this some further thought.

In the meantime, you can provide a custom JwtClientAssertionAuthenticationProvider.setJwtDecoderFactory() similar to JwtClientAssertionDecoderFactory but scaled down to only support jwk-set-url lookup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants