-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Prefer token endpoint auth method obtained during OAuth client registration #951
Copy link
Copy link
Open
Labels
P2Moderate issues affecting some users, edge cases, potentially valuable featureModerate issues affecting some users, edge cases, potentially valuable featureauthIssues and PRs related to Authentication / OAuthIssues and PRs related to Authentication / OAuthbugSomething isn't workingSomething isn't workingpotentially closeBot recommends closing — needs maintainer reviewBot recommends closing — needs maintainer reviewready for workEnough information for someone to start working onEnough information for someone to start working on
Milestone
Metadata
Metadata
Assignees
Labels
P2Moderate issues affecting some users, edge cases, potentially valuable featureModerate issues affecting some users, edge cases, potentially valuable featureauthIssues and PRs related to Authentication / OAuthIssues and PRs related to Authentication / OAuthbugSomething isn't workingSomething isn't workingpotentially closeBot recommends closing — needs maintainer reviewBot recommends closing — needs maintainer reviewready for workEnough information for someone to start working onEnough information for someone to start working on
Describe the bug
When doing an OAuth flow using dynamic client registration, the
token_endpoint_auth_methodreturned in the registration data should be used to request a token, rather than the one from the OAuth authorization server metadata. Not doing this may cause an OAuth flow to fail if a strict server requires the method that was posted and used during client registration.To Reproduce
Steps to reproduce the behavior:
src/examples/client/simpleOAuthClient.ts) which specifiestoken_endpoint_auth_method: 'client_secret_post'in theOAuthClientMetadata.client_secret_post, and we assume that the server will confirm that in the registration response.exchangeAuthorizationand inrefreshAuthorization(src/client/auth.ts), the following code is used:and
selectClientAuthMethoduses this check which takes the supported methods from the OAuth authorization servermetadata, rather than theclientInformation:client_secret_basicbeing used rather thanclient_secret_postsince the server may not need to honorclient_secret_basicanymore after the client was registered withclient_secret_post.Expected behavior
Prefer the
token_endpoint_auth_methodfrom the clientclientInformationthat was obtained during registration, and only if it's unavailable fall back to themetadatafrom the OAuth authorization server.