diff --git a/src/Grant/AuthCodeGrant.php b/src/Grant/AuthCodeGrant.php index 406f6ab8..e969df8e 100644 --- a/src/Grant/AuthCodeGrant.php +++ b/src/Grant/AuthCodeGrant.php @@ -71,6 +71,7 @@ class AuthCodeGrant extends AbstractAuthorizeGrant throw OAuthServerException::invalidRequest('client_id'); } + // Only validate the client if it is confidential if ($this->clientRepository->isClientConfidential($clientId)) { $client = $this->validateClient($request); } else { @@ -82,12 +83,6 @@ class AuthCodeGrant extends AbstractAuthorizeGrant ); } - // Validate request - - // HERE I ONLY WANT TO VALIDATE IF THE CLIENT IS CONFIDENTIAL! - - - $encryptedAuthCode = $this->getRequestParameter('code', $request, null); if ($encryptedAuthCode === null) {