Closed alibarthi closed 4 years ago
Hi,
Global '*' scope is not set when issuing tokens, because the social grant is not a valid grantType in Laravel\Passport\Bridge\ScopeRepository, the finalizeScopes function: https://github.com/laravel/passport/blob/63c8b6645b2503af10ae3f64938c12b2790ac753/src/Bridge/ScopeRepository.php#L24
Laravel\Passport\Bridge\ScopeRepository
finalizeScopes
public function finalizeScopes( array $scopes, $grantType, ClientEntityInterface $clientEntity, $userIdentifier = null) { if (! in_array($grantType, ['password', 'personal_access', 'client_credentials'])) { $scopes = collect($scopes)->reject(function ($scope) { return trim($scope->getIdentifier()) === '*'; })->values()->all(); } ... }
With this proposed change, we can simply finalizeScopes as for the 'password' grant, since social grant is based on it anyway.
Maybe fixes #20 where default scope is not being set on tokens
Hi,
Global '*' scope is not set when issuing tokens, because the social grant is not a valid grantType in
Laravel\Passport\Bridge\ScopeRepository
, thefinalizeScopes
function: https://github.com/laravel/passport/blob/63c8b6645b2503af10ae3f64938c12b2790ac753/src/Bridge/ScopeRepository.php#L24With this proposed change, we can simply finalizeScopes as for the 'password' grant, since social grant is based on it anyway.
Maybe fixes #20 where default scope is not being set on tokens