From 2482630221bef4347e37c02fe5119a18f9ceda99 Mon Sep 17 00:00:00 2001 From: Erick Torres Date: Fri, 16 Jun 2017 12:02:34 -0500 Subject: [PATCH] Fix codeVerifier hash verification. --- src/Grant/AuthCodeGrant.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Grant/AuthCodeGrant.php b/src/Grant/AuthCodeGrant.php index df89400e..7e64b416 100644 --- a/src/Grant/AuthCodeGrant.php +++ b/src/Grant/AuthCodeGrant.php @@ -144,7 +144,7 @@ class AuthCodeGrant extends AbstractAuthorizeGrant case 'S256': if ( hash_equals( - urlencode(base64_encode(hash('sha256', $codeVerifier))), + rtrim(strtr(base64_encode(hash('sha256', $codeVerifier, true)), '+/', '-_'), '='), $authCodePayload->code_challenge ) === false ) {