Skip to content

Missing support for private_key_jwt in WebClientReactiveClientCredentialsTokenResponseClient #10145

Closed
@Giambapisasale

Description

@Giambapisasale

Describe the bug
I'm trying to set up an OAuth2 client against okta with private_key_jwt authentication and client_credentials flow, in Reactive context (not Servlet).
But when I try to use a NimbusJwtClientAuthenticationParametersConverter<>(jwkResolver) with a private key I cannot add the converter to WebClientReactiveClientCredentialsTokenResponseClient.

The converter is appliable only to DefaultClientCredentialsTokenResponseClient, while WebClientReactiveClientCredentialsTokenResponseClient lacks of support for private_key_jwt.

To Reproduce
OAuth2ClientCredentialsGrantRequestEntityConverter requestEntityConverter = new OAuth2ClientCredentialsGrantRequestEntityConverter();
requestEntityConverter.addParametersConverter(new NimbusJwtClientAuthenticationParametersConverter<>(jwkResolver));

// DefaultClientCredentialsTokenResponseClient clientCredentialsTokenResponseClient = new DefaultClientCredentialsTokenResponseClient();
// clientCredentialsTokenResponseClient.setRequestEntityConverter(requestEntityConverter);

    WebClientReactiveClientCredentialsTokenResponseClient wc = new WebClientReactiveClientCredentialsTokenResponseClient();

// wc.setWebClient(webClient); // questo dovrà essere compatibile con proxy e mtls

    ClientCredentialsReactiveOAuth2AuthorizedClientProvider prov = new ClientCredentialsReactiveOAuth2AuthorizedClientProvider();
    
    prov.setAccessTokenResponseClient(wc);
    authorizedClientManager.setAuthorizedClientProvider(prov);
    
    ServerOAuth2AuthorizedClientExchangeFilterFunction oauth = new ServerOAuth2AuthorizedClientExchangeFilterFunction(
            authorizedClientManager);
    oauth.setDefaultClientRegistrationId("buyerbank");

Expected behavior
wc.setRequestEntityConverter(requestEntityConverter);

(I think is a bug, not a enhancemente request)

Metadata

Metadata

Assignees

Labels

in: oauth2An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)status: duplicateA duplicate of another issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions