mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-05-31 14:12:07 +05:30
Client says if it is confidential instead of repository
This commit is contained in:
@@ -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);
|
||||
|
@@ -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.
|
||||
*
|
||||
|
Reference in New Issue
Block a user