Added $mustValidateSecret parameter to ClientRepositoryInterface:: getClientEntity(). Fixes #550

This commit is contained in:
Alex Bilbie 2016-04-18 08:32:49 +01:00
parent 5b192b3548
commit fb8f47e868
4 changed files with 14 additions and 7 deletions

View File

@ -161,7 +161,8 @@ abstract class AbstractGrant implements GrantTypeInterface
$client = $this->clientRepository->getClientEntity(
$clientId,
$this->getIdentifier(),
$clientSecret
$clientSecret,
true
);
if (!$client instanceof ClientEntityInterface) {

View File

@ -165,7 +165,9 @@ class AuthCodeGrant extends AbstractAuthorizeGrant
$client = $this->clientRepository->getClientEntity(
$clientId,
$this->getIdentifier()
$this->getIdentifier(),
null,
false
);
if ($client instanceof ClientEntityInterface === false) {

View File

@ -117,7 +117,9 @@ class ImplicitGrant extends AbstractAuthorizeGrant
$client = $this->clientRepository->getClientEntity(
$clientId,
$this->getIdentifier()
$this->getIdentifier(),
null,
false
);
if ($client instanceof ClientEntityInterface === false) {

View File

@ -16,11 +16,13 @@ interface ClientRepositoryInterface extends RepositoryInterface
/**
* Get a client.
*
* @param string $clientIdentifier The client's identifier
* @param string $grantType The grant type used
* @param null|string $clientSecret The client's secret (if sent)
* @param string $clientIdentifier The client's identifier
* @param string $grantType The grant type used
* @param null|string $clientSecret The client's secret (if sent)
* @param bool $mustValidateSecret If true the client must attempt to validate the secret unless the client
* is confidential
*
* @return \League\OAuth2\Server\Entities\ClientEntityInterface
*/
public function getClientEntity($clientIdentifier, $grantType, $clientSecret = null);
public function getClientEntity($clientIdentifier, $grantType, $clientSecret = null, $mustValidateSecret = true);
}