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

Consider adding ClientRegistrationIdResolver to ExchangeFilterFunctions #15825

Open
Tracked by #15299
sjohnr opened this issue Sep 18, 2024 · 1 comment
Open
Tracked by #15299
Assignees
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) type: enhancement A general enhancement
Milestone

Comments

@sjohnr
Copy link
Member

sjohnr commented Sep 18, 2024

We should align (Server|Servlet)OAuth2AuthorizedClientExchangeFilterFunction with OAuth2ClientHttpRequestInterceptor which introduces a ClientRegistrationIdResolver as a flexible strategy for resolving the clientRegistrationId for a given request. For WebClient-based ExchangeFilterFunctions, the interface could be:

@FunctionalInterface
public interface ClientRegistrationIdResolver {

	@Nullable
	String resolve(ClientRequest request);

}
@sjohnr sjohnr added type: enhancement A general enhancement in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) labels Sep 18, 2024
@sjohnr sjohnr added this to the 6.4.x milestone Sep 18, 2024
@sjohnr sjohnr self-assigned this Sep 18, 2024
@sjohnr sjohnr changed the title Consider adding ClientRegistrationIdResolver to (Server|Servlet)OAuth2AuthorizedClientExchangeFilterFunction Consider adding ClientRegistrationIdResolver to ExchangeFilterFunctions Sep 18, 2024
@sjohnr sjohnr modified the milestones: 6.4.x, 6.5.x Dec 13, 2024
@sjohnr
Copy link
Member Author

sjohnr commented Dec 13, 2024

Note: When considering ServerOAuth2AuthorizedClientExchangeFilterFunction may need to return Mono<String>:

@FunctionalInterface
public interface ClientRegistrationIdResolver {

	@Nullable
	Mono<String> resolve(ClientRequest request);

}

Related gh-16284.

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) type: enhancement A general enhancement
Projects
Status: No status
Development

No branches or pull requests

1 participant