芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/public_html/mctv/lib/OAuth/AccessTokenRepository.php
. */ namespace Xibo\OAuth; use League\OAuth2\Server\Entities\AccessTokenEntityInterface; use League\OAuth2\Server\Entities\ClientEntityInterface; use League\OAuth2\Server\Repositories\AccessTokenRepositoryInterface; /** * Class AccessTokenRepository * @package Xibo\Storage */ class AccessTokenRepository implements AccessTokenRepositoryInterface { /** @var \Xibo\Service\LogServiceInterface*/ private $logger; /** * AccessTokenRepository constructor. * @param \Xibo\Service\LogServiceInterface $logger */ public function __construct($logger) { $this->logger = $logger; } /** @inheritDoc */ public function getNewToken(ClientEntityInterface $clientEntity, array $scopes, $userIdentifier = null) { $this->logger->debug('Getting new Access Token'); $accessToken = new AccessTokenEntity(); $accessToken->setClient($clientEntity); foreach ($scopes as $scope) { $accessToken->addScope($scope); } // client credentials, we take user from the client entity if ($userIdentifier === null) { $accessToken->setUserIdentifier($clientEntity->userId); } else { // authentication code, we should have a userIdentifier here $accessToken->setUserIdentifier($userIdentifier); } return $accessToken; } /** @inheritDoc */ public function isAccessTokenRevoked($tokenId) { // TODO: Implement isAccessTokenRevoked() method. } /** @inheritDoc */ public function persistNewAccessToken(AccessTokenEntityInterface $accessTokenEntity) { // TODO: Implement persistNewAccessToken() method. } /** @inheritDoc */ public function revokeAccessToken($tokenId) { // TODO: Implement revokeAccessToken() method. return false; } }