-
Notifications
You must be signed in to change notification settings - Fork 259
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
Added support for client_credentials grant type #47
base: master
Are you sure you want to change the base?
Added support for client_credentials grant type #47
Conversation
Hi @brandon-miles. Thanks for contributing this. I have a few questions/concerns though. I don't see any provisions made for authenticating the client. The specification makes it pretty clear in Section 3.2.1 that the authorization server must authenticate the client:
The specification does suggest a few means for doing this in Section 2.3 which we should probably explore. So, while Also, you don't have tests :( Let's get this started though. If you're implementing this grant type, what is your use case? Do you have a real world implementation that you're accommodating that we could reference? My initial thoughts are to provide some sort of authentication backend for authenticating the client based on upon credentials that are agreed upon up front (username+password, public key, etc.) and then extending the access token view to require authentication for this case. Just a thought... |
Hi @eculver, Thanks for taking a look. In our implementation we allow a user to register a client (obtaining a client_id and client_secret) once they have authenticated via our corporate auth. Since we initially have to redirect the user to a corporate auth URL, we never have a chance to accept their username + password, so the We also don't have a choice as to what the corporate auth sends us back as a response (they just send us back an LDAP entry), so the The As for the tests, sorry for not including those. I'll get those added to this PR when I get a chance. Let me know if I'm missing anything here, or if you have any questions on our particular use case. Thanks again! -Brandon |
Ok, tests have been added. Let me know if there's anything else I missed. |
Hi @eculver, The tests have been added a while back. Can you have a look at this again when you get a chance? Thanks! |
Hi @brandon-miles, We're using this package and are really hoping to get client credentials support in, so I pulled a copy of your branch and started to explore. With Client Credentials the user to associate with the issued
As far as authentication, since we don't necessarily have a Hopefully we can get this PR merged in soon :) -Nick |
What's the status of this PR? With the current changes and with the user nullable I don't think there will be any violation of the OAuth2.0 protocol when requesting an access token. |
If I could add to this discussion; I've been reviewing this lib and django-oauth-toolkit, and this is one of the more annoying points in that library as well. Tokens have to be bound to users, but this design decision seems to be an oversight when looking at the client_credentials grant type in particular. Tokens should not be required to be bound to users, as they can be assigned to an application/client directly. One other consideration is that client_credentials is one of the major grant types defined in the specification; this library should be considered incomplete until its support has been included. |
@eculver Is merging this PR on the roadmap? |
Any update on this issue? I'd really like to make use of this functionality for my server-to-server APIs. |
This adds support for the client credentials grant as found in section 4.4 of the RFC.