Repository navigation
feature: Added configurable token endpoint auth method selection - #1496
RobotechUSA wants to merge 24 commits into
Conversation
The OAuth client currently selects the first token endpoint authentication method advertised by the authorization server. That can fail when servers expose multiple supported methods and the caller needs to prefer a different option based on client type or credentials. Added TokenEndpointAuthMethodSelector to ClientOAuthOptions and use it in ClientOAuthProvider when resolving the token endpoint auth method. Preserve the existing behavior by defaulting to the first advertised method when no selector is provided.
|
#1615 proposes an explicit |
Thanks for taking a look and for laying out the comparison. The idea behind this PR was to keep the SDK unopinionated. Instead of the SDK picking the token endpoint auth method, the selector hands that decision, along with any validation of what discovery returns, to the application. I also wanted to keep the change to the SDK as small as possible while still covering our scenario. That said, the explicit I understand the preference for the explicit setting, and I'm ok with you closing this in favor of #1615. Thanks again for considering my effort. |
Summary
The OAuth client currently selects the first token endpoint authentication method advertised by the authorization server. That can fail when a server exposes multiple supported methods and the client needs to prefer a specific method based on client type or available credentials.
This change adds TokenEndpointAuthMethodSelector to ClientOAuthOptions and uses it in ClientOAuthProvider when resolving the token endpoint authentication method. Existing behavior is preserved by defaulting to the first advertised method when no selector is provided.
Motivation and Context
Some authorization servers advertise multiple token endpoint authentication methods. In those cases, always choosing the first advertised method is not flexible enough for clients that need to prefer a different supported method.
This change allows callers to control that selection without changing the default behavior for existing consumers.
How Has This Been Tested?
Validated in a downstream application that requires selecting a specific token endpoint authentication method.
Breaking Changes
This is a non-breaking change. Existing behavior is preserved when TokenEndpointAuthMethodSelector is not configured.
Types of changes
Checklist
Additional context
N/A