-
Notifications
You must be signed in to change notification settings - Fork 2.5k
OAuth Update: Adding the Client Credentials & Token Exchange Grant Types #882
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
base: main
Are you sure you want to change the base?
OAuth Update: Adding the Client Credentials & Token Exchange Grant Types #882
Conversation
…for-oauth-client-credentials Add OAuth client credentials grant
…mplement-client-credentials-support Fix auth registration for client credentials
…mentation-of-client-credentials-flow Refactor auth helper methods
Fix failing tests and pyright
…eerror-in-pytest-test-case Fix OAuth tests using async fixtures
Fix resumption token update logic
Add OAuth token exchange support
…change-implementation-for-test-failures Fix token exchange metadata tests
Reported-by: sachabaniassad
Fix pyright case issues in tests and example
Since #1020 was closed, I took a look at the code here, leaving a few comments:
|
…e-review-comments-for-implementation refactor: unify OAuth providers and support basic auth
Thank you for your comments! In my recent commits, here's what I changed to address your concerns.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @SoldierSacha thanks for this contribution! And apologies for the time it took to get back to this.
I checked with @pcarleton and it looks like this change is still pending SEP-1046: modelcontextprotocol/modelcontextprotocol#1047
I'm going to request changes for now as there will still be merge conflict resolution and potentially minor changes needed once that SEP is accepted.
…y-return-statements Refactor token handler helper flows
Thanks for the update, @felixweinberger! Understood — I’ll keep an eye on SEP-1046. Once that’s accepted and merged, I’ll rebase again and make any necessary adjustments. For now, I’ve gone ahead and updated this branch with the latest changes from Appreciate the review! |
Motivation and Context
#881
In addition to adding the Client Credentials grant (from the issue linked above), I've also gone on to add the Token Exchange grant.
Reasoning for Token Exchange: Since the client credentials grant is for machine-to-machine authorization, I realized that there are times where the client machine (acting as an MCP Client) might have to make requests on behalf of an end-user to the MCP Server. With that being said, in the current implementation, this did not exist because there was no way to securely identify the end-user.
Now it does through Token Exchange.
How Has This Been Tested?
Added test cases (all pass), and also currently using in my own mcp server and client. Everything is working as intended.
Breaking Changes
None
Types of changes
Checklist
Additional context
No