-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Example client repository allows public clients when it shouldn't #1034
Comments
Something that was confusing to me about this is the However the refresh token grant and password grant both are supposed to support public clients according to the OAuth specification and do not check Wouldn't that mean the |
Hi Matt. Thanks for spotting this. Personally I think that we should only allow confidential clients so update the grant. Previously we didn't do this as we had no way of knowing if a client was confidential. We left those details up to the implementer. I think it would be wise we update the grant now to restrict it to confidential clients only. For the other grants, we should probably follow suit. We should only validate a client's credentials if it is confidential. Part of the problem with this is at that point, the credentials have already been transmitted but I suppose it is enforcing good practice within the library. |
Closing this as the original issue has been resolved. I've opened up issue #1073 to deal with the public client support issue. Thanks @matt-allan |
The client credentials grant should only be used by confidential clients:
https://tools.ietf.org/html/rfc6749#section-4.4.2
The
ClientCredentialsGrant
class does not validate that the client is confidential, but instead callsClientRepository::validateClient
.To prevent a public client from using the client credentials grant type you would need to check the
$grantType
and fail validation if it's client credentials and the client is public.However, the example ClientRepository does not do this and if you follow the example public clients would be allowed to use the client credentials grant type.
You can illustrate the problem by adding a public client to the example and making a curl request:
Should the example be updated, or should we update the
ClientCredentialsGrant
to checkClient::isConfidential
so it's not necessary to check invalidateClient
?The text was updated successfully, but these errors were encountered: