Client says if it is confidential instead of repository

This commit is contained in:
sephster
2018-09-01 14:53:27 +01:00
parent cfa9b8d3b4
commit 3eabbafe5b
3 changed files with 3 additions and 33 deletions

View File

@@ -79,16 +79,11 @@ class AuthCodeGrant extends AbstractAuthorizeGrant
throw OAuthServerException::invalidRequest('client_id');
}
$client = $this->clientRepository->getClientEntity($clientId);
// Only validate the client if it is confidential
if ($this->clientRepository->isClientConfidential($clientId)) {
if ($client->isConfidential()) {
$client = $this->validateClient($request);
} else {
$client = $this->clientRepository->getClientEntity(
$clientId,
$this->getIdentifier(),
null,
false
);
}
$encryptedAuthCode = $this->getRequestParameter('code', $request, null);

View File

@@ -25,15 +25,6 @@ interface ClientRepositoryInterface extends RepositoryInterface
*/
public function getClientEntity($clientIdentifier);
/**
* Check if a client is confidential.
*
* @param string $clientIdentifier The client's identifier
*
* @return bool
*/
public function isClientConfidential($clientIdentifier);
/**
* Validate a client's secret.
*