Source of file ClientRepository.php
Size: 0,875 Bytes - Last Modified: 2022-02-21T10:00:46+00:00
/var/www/docs.ssmods.com/process/src/src/Repositories/ClientRepository.php
1234567891011121314151617181920212223242526272829 | <?php namespace AdvancedLearning\Oauth2Server\Repositories; use AdvancedLearning\Oauth2Server\Entities\ClientEntity; use function hash_equals; use League\OAuth2\Server\Repositories\ClientRepositoryInterface; use const PHP_EOL; class ClientRepository implements ClientRepositoryInterface { /** * {@inheritdoc} */ public function getClientEntity($clientIdentifier, $grantType, $clientSecret = null, $mustValidateSecret = true) { $client = \AdvancedLearning\Oauth2Server\Models\Client::get()->filter([ 'Identifier' => $clientIdentifier ])->first(); if ($mustValidateSecret && $client && !hash_equals($client->Secret, $clientSecret)) { $client = null; } return $client && $client->hasGrantType($grantType) ? new ClientEntity($clientIdentifier, $client->Name, 'something') : null; } } |