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

Make oAuth request with load balanced web client #9500

Closed
Munoon opened this issue Mar 14, 2021 · 1 comment
Closed

Make oAuth request with load balanced web client #9500

Munoon opened this issue Mar 14, 2021 · 1 comment
Assignees
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) status: duplicate A duplicate of another issue

Comments

@Munoon
Copy link

Munoon commented Mar 14, 2021

Expected Behavior
I want to make some oAuth requests using a loadbalancer. For example, requests to get a token, refresh a token, or request user information. I want to use multiple service instances to make this requests, not just one. For example, I want to use eureka to specify service instance for each token request.

Current Behavior
To make it by hand, I should override beans, that makes this request and set to them custom web client. Example:

@Bean
DefaultReactiveOAuth2UserService defaultReactiveOAuth2UserService() {
    var userService = new DefaultReactiveOAuth2UserService();
    userService.setWebClient(loadBalancedWebClient);
    return userService;
}

@Bean
ReactiveOAuth2AccessTokenResponseClient<OAuth2AuthorizationCodeGrantRequest> reactiveOAuth2AccessTokenResponseClient() {
    var accessTokenResponseClient = new WebClientReactiveAuthorizationCodeTokenResponseClient();
    accessTokenResponseClient.setWebClient(loadBalancedWebClient);
    return accessTokenResponseClient;
}

But, for example, it is really hard to set custom web client for AbstractWebClientReactiveOAuth2AccessTokenResponseClient, which make request to refresh expired token.

Context
Because of this problems, it is really hard to make our microservice system scalable. Framework require to use only one specified server, which is really bad.

@Munoon Munoon added status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement labels Mar 14, 2021
@jgrandja
Copy link
Contributor

@Munoon It looks like this is a duplicate of #8882

@jgrandja jgrandja added in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement labels Mar 16, 2021
@jgrandja jgrandja self-assigned this Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

2 participants