Skip to content
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

Prevent public clients from using the client_credentials grant type #1035

Merged
merged 5 commits into from
Jul 25, 2019
Merged

Prevent public clients from using the client_credentials grant type #1035

merged 5 commits into from
Jul 25, 2019

Conversation

matt-allan
Copy link
Contributor

This PR updates the ClientCredentialsGrant to fail if the client is not confidential.

According to the OAuth specification the client credentials grant type should only be used with confidential clients.

The client MUST authenticate with the authorization server as described in Section 3.2.1.

https://tools.ietf.org/html/rfc6749#section-4.4.2

While it's possible to check this in the validateClient method it's possible the user failed to do so. As explained in #1034 the example repository is not checking this and the docs don't tell you to check this either so it's likely other developers have missed this.

By checking it in the ClientCredentialsGrant we don't need to require the user to implement the check themselves.

I had to update a few tests that were relying on this behavior.

@Sephster
Copy link
Member

Thanks @matt-allan - looks good. I made some minor adjustments to formatting and added a note in the changelog but otherwise is good to go. Thanks for submitting this!

@Sephster Sephster merged commit 0b0b43d into thephpleague:master Jul 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants