From 4a725274d7f7ec332b6d219db69edc1af192a994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20J=2E=20Garc=C3=ADa=20Lagar?= Date: Tue, 21 May 2019 09:34:01 +0200 Subject: [PATCH] Fix scope comparison --- League/Repository/ScopeRepository.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/League/Repository/ScopeRepository.php b/League/Repository/ScopeRepository.php index eb525a04..22d02ee2 100644 --- a/League/Repository/ScopeRepository.php +++ b/League/Repository/ScopeRepository.php @@ -109,10 +109,12 @@ private function setupScopes(ClientModel $client, array $requestedScopes): array } $finalizedScopes = []; + $clientScopesAsStrings = array_map('strval', $clientScopes); foreach ($requestedScopes as $requestedScope) { - if (!\in_array($requestedScope, $clientScopes, true)) { - throw OAuthServerException::invalidScope((string) $requestedScope); + $requestedScopeAsString = (string) $requestedScope; + if (!\in_array($requestedScopeAsString, $clientScopesAsStrings, true)) { + throw OAuthServerException::invalidScope($requestedScopeAsString); } $finalizedScopes[] = $requestedScope;