Source of file ClientRepository.php
Size: 0,967 Bytes - Last Modified: 2021-12-24T05:17:09+00:00
/var/www/docs.ssmods.com/process/src/code/Repositories/ClientRepository.php
12345678910111213141516171819202122232425262728293031323334353637383940 | <?php /** * @author Ian Simpson <ian@iansimpson.nz> * @copyright Copyright (c) Ian Simpson */ namespace IanSimpson\OAuth2\Repositories; use League\OAuth2\Server\Repositories\ClientRepositoryInterface; use IanSimpson\OAuth2\Entities\ClientEntity; class ClientRepository implements ClientRepositoryInterface { /** * {@inheritdoc} */ public function getClientEntity($clientIdentifier, $grantType = null, $clientSecret = null, $mustValidateSecret = true) { $clients = ClientEntity::get()->filter([ 'ClientIdentifier' => $clientIdentifier, ]); // Check if client is registered if (!sizeof($clients)) { return null; } /** @var ClientEntity $client */ $client = $clients->first(); if ($mustValidateSecret === true && !$client->isSecretValid($clientSecret) ) { return null; } return $client; } } |