-
Notifications
You must be signed in to change notification settings - Fork 789
Description
Hi, the rfc says (https://tools.ietf.org/html/rfc6749#page-23) that when a client does not pass a scope parameter, the server can choose to either return a default set of scopes, or a scope error. Laravel kind of does neither. When I omit the scope parameter laravel simply doesn't set a scope, and doesn't return a scope error.
The league server does support a setDefaultScope method on the AuthorizationServer specifically for this, but unfortunately right now the only way to be able to set that is through the PassportServiceProvider in the registerAuthorizationServer singleton. When you enable a grant, the oauth2 server can set a previously set default scope.
see: https://github.com/thephpleague/oauth2-server/blob/master/src/Grant/AuthCodeGrant.php#L259
It would be nice if we could do a Passport::setDefaultScope([..]) through the AuthServiceProvider, and then have passport set that on the AuthorizationServer before enabling the grants. I implemented that locally as a test and that works great. Would a PR be welcome for this? Or is this not something laravel would want to support?