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 PrincipalResolver to ExchangeFilterFunctions #16284

Open
Tracked by #15299
sjohnr opened this issue Dec 13, 2024 · 0 comments
Open
Tracked by #15299

Consider adding PrincipalResolver to ExchangeFilterFunctions #16284

sjohnr opened this issue Dec 13, 2024 · 0 comments
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 Dec 13, 2024

We should align (Server|Servlet)OAuth2AuthorizedClientExchangeFilterFunction with OAuth2ClientHttpRequestInterceptor which introduces a PrincipalResolver as a flexible strategy for resolving the Authentication for a given request.

For ServletOAuth2AuthorizedClientExchangeFilterFunction, the interface could be:

@FunctionalInterface
public interface PrincipalResolver {

	@Nullable
	Authentication resolve(ClientRequest request);

}

For ServerOAuth2AuthorizedClientExchangeFilterFunction, it may need to return a Mono<Authentication> to accommodate ReactiveSecurityContextHolder:

@FunctionalInterface
public interface PrincipalResolver {

	@Nullable
	Mono<Authentication> 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 Dec 13, 2024
@sjohnr sjohnr added this to the 6.5.x milestone Dec 13, 2024
@sjohnr sjohnr self-assigned this Dec 13, 2024
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