-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Implement support for client_credentials
and RFC 7523
#1020
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
Implement support for client_credentials
and RFC 7523
#1020
Conversation
I also implemented this, along with the token exchange grant type in addition to client credentials |
…-sdk into feat/client-credentials
@pcarleton @dsp-ant Let me know if I should close this in favor of #882, or if the credential grants should be PR'd separately (whether that looks like #882 being split or scoped down to |
client_credentials
client_credentials
and RFC 7523
Added a client implementation of RFC 7523 to support SEP-1046. I'll add a server implementation within the next few days. |
No longer doing external integration examples as of modelcontextprotocol#1011. Will likely bring this back later as a standalone example.
Changes:
Unsure about if we should have a server implementation now, reviewing the last core maintainer meeting notes: modelcontextprotocol/modelcontextprotocol#1061
As a practical matter, that guidance complicates testing, however. edit: Discussing alternatives on Discord. |
Hi @LucaButBoring, thanks for your PR! After chatting w/ the team it would seem indeed that something along the lines of #882 would reduce the maintenance complexity (changes encapsulated in httpx.Auth), although it's still TBD whether we do want to onboard these features (pending discussion / decision on modelcontextprotocol/modelcontextprotocol#1046). Closing this for now (thanks again!), but do let me know if you feel strongly otherwise ✌️ |
Sounds good, I believe in the future we want to start using |
Implements support for the
client_credentials
flow overclient_secret_basic
/client_secret_post
. Requires the client to explicitly declare support for theclient_credentials
grant type, as demonstrated in the example code.Motivation and Context
Enables machine-to-machine auth and using IdPs that don't support a code grant flow.
How Has This Been Tested?
Added an example that integrates with Discord using this flow. The example does not use Dynamic Client Registration because the OAuthProvider boilerplate that offers that has the authorization code grant flow baked into it right now. Instead, a dummy client ID and client secret are hardcoded in the
TokenStorage
implementation.Breaking Changes
OAuthClientInformationFull.client_id
is now optional as described in the OAuth 2.1 specification, section 3.2.2.Types of changes
Checklist
Additional context
#709