From 04807a1e2ae155b9d3c9b14b3aa2d4ff79cdfe59 Mon Sep 17 00:00:00 2001 From: Andrew Millington Date: Sun, 12 Aug 2018 20:29:39 +0100 Subject: [PATCH] Fix incorrect variable reference --- src/Grant/AuthCodeGrant.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Grant/AuthCodeGrant.php b/src/Grant/AuthCodeGrant.php index e969df8e..6e38bc09 100644 --- a/src/Grant/AuthCodeGrant.php +++ b/src/Grant/AuthCodeGrant.php @@ -49,6 +49,14 @@ class AuthCodeGrant extends AbstractAuthorizeGrant $this->refreshTokenTTL = new \DateInterval('P1M'); } + /** + * Disable the requirement for a code challenge for public clients. + */ + public function disableCodeChallengeForPublicClients() + { + $this->requireCodeChallengeForPublicClients = false; + } + /** * Respond to an access token request. * @@ -185,7 +193,7 @@ class AuthCodeGrant extends AbstractAuthorizeGrant ); // @codeCoverageIgnoreEnd } - } else if ($this->$requireCodeChallengeForPublicClients && !$client->isConfidential()) { + } else if ($this->requireCodeChallengeForPublicClients && !$client->isConfidential()) { throw OAuthServerException::invalidRequest('code_challenge', 'Code challenge must be provided for public clients'); }