mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-01-09 21:37:59 +05:30
34 lines
817 B
PHP
34 lines
817 B
PHP
<?php
|
|
/**
|
|
* @author Alex Bilbie <hello@alexbilbie.com>
|
|
* @copyright Copyright (c) Alex Bilbie
|
|
* @license http://mit-license.org/
|
|
*
|
|
* @link https://github.com/thephpleague/oauth2-server
|
|
*/
|
|
|
|
namespace OAuth2ServerExamples\Repositories;
|
|
|
|
use League\OAuth2\Server\Entities\ClientEntityInterface;
|
|
use League\OAuth2\Server\Repositories\UserRepositoryInterface;
|
|
use OAuth2ServerExamples\Entities\UserEntity;
|
|
|
|
class UserRepository implements UserRepositoryInterface
|
|
{
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function getUserEntityByUserCredentials(
|
|
$username,
|
|
$password,
|
|
$grantType,
|
|
ClientEntityInterface $clientEntity
|
|
) {
|
|
if ($username === 'alex' && $password === 'whisky') {
|
|
return new UserEntity();
|
|
}
|
|
|
|
return;
|
|
}
|
|
}
|