Skip to content

Commit 0499b40

Browse files
authored
Merge pull request #949 from philcross/fix_client_credentials_superuser_scope
[7.0] Allow '*' scope to be used with Client Credentials
2 parents 93241bd + ba24487 commit 0499b40

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Bridge/ScopeRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function finalizeScopes(
2525
array $scopes, $grantType,
2626
ClientEntityInterface $clientEntity, $userIdentifier = null)
2727
{
28-
if (! in_array($grantType, ['password', 'personal_access'])) {
28+
if (! in_array($grantType, ['password', 'personal_access', 'client_credentials'])) {
2929
$scopes = collect($scopes)->reject(function ($scope) {
3030
return trim($scope->getIdentifier()) === '*';
3131
})->values()->all();

tests/BridgeScopeRepositoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function test_superuser_scope_cant_be_applied_if_wrong_grant()
3434
$repository = new ScopeRepository;
3535

3636
$scopes = $repository->finalizeScopes(
37-
[$scope1 = new Scope('*')], 'client_credentials', new Client('id', 'name', 'http://localhost'), 1
37+
[$scope1 = new Scope('*')], 'refresh_token', new Client('id', 'name', 'http://localhost'), 1
3838
);
3939

4040
$this->assertEquals([], $scopes);

0 commit comments

Comments
 (0)