Conditions | 5 |
Paths | 3 |
Total Lines | 8 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
50 | public function verifyScopes(ClientInterface $client, ?array $scopes): void |
||
51 | { |
||
52 | if ($client instanceof RegisteredClient && is_array($client->getMetadata()->getScope())) { |
||
|
|||
53 | $supportedScopes = explode(' ', $client->getMetadata()->getScope()); |
||
54 | if(empty($scopes) || !empty(array_diff($scopes, $supportedScopes))) { |
||
55 | throw new OAuthException('invalid_scope', |
||
56 | 'The request scope is invalid. Supported scopes : '.$client->getMetadata()->getScope(), |
||
57 | 'https://tools.ietf.org/html/rfc6749#section-4.1'); |
||
58 | } |
||
62 | } |