mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-01-13 07:12:38 +05:30
70 lines
1.9 KiB
PHP
70 lines
1.9 KiB
PHP
<?php
|
|
/**
|
|
* OAuth 2.0 Access token storage interface
|
|
*
|
|
* @package league/oauth2-server
|
|
* @author Alex Bilbie <hello@alexbilbie.com>
|
|
* @copyright Copyright (c) Alex Bilbie
|
|
* @license http://mit-license.org/
|
|
* @link https://github.com/thephpleague/oauth2-server
|
|
*/
|
|
|
|
namespace League\OAuth2\Server\Storage;
|
|
|
|
use League\OAuth2\Server\Entity\AccessTokenEntity;
|
|
use League\OAuth2\Server\Entity\ScopeEntity;
|
|
|
|
/**
|
|
* Access token interface
|
|
*/
|
|
interface AccessTokenInterface extends StorageInterface
|
|
{
|
|
/**
|
|
* Get an instance of Entity\AccessTokenEntity
|
|
*
|
|
* @param string $token The access token
|
|
*
|
|
* @return \League\OAuth2\Server\Entity\AccessTokenEntity
|
|
*/
|
|
public function get($token);
|
|
|
|
/**
|
|
* Get the scopes for an access token
|
|
*
|
|
* @param \League\OAuth2\Server\Entity\AccessTokenEntity $token The access token
|
|
*
|
|
* @return array Array of \League\OAuth2\Server\Entity\ScopeEntity
|
|
*/
|
|
public function getScopes(AccessTokenEntity $token);
|
|
|
|
/**
|
|
* Creates a new access token
|
|
*
|
|
* @param string $token The access token
|
|
* @param integer $expireTime The expire time expressed as a unix timestamp
|
|
* @param string|integer $sessionId The session ID
|
|
*
|
|
* @return void
|
|
*/
|
|
public function create($token, $expireTime, $sessionId);
|
|
|
|
/**
|
|
* Associate a scope with an acess token
|
|
*
|
|
* @param \League\OAuth2\Server\Entity\AccessTokenEntity $token The access token
|
|
* @param \League\OAuth2\Server\Entity\ScopeEntity $scope The scope
|
|
*
|
|
* @return void
|
|
*/
|
|
public function associateScope(AccessTokenEntity $token, ScopeEntity $scope);
|
|
|
|
/**
|
|
* Delete an access token
|
|
*
|
|
* @param \League\OAuth2\Server\Entity\AccessTokenEntity $token The access token to delete
|
|
*
|
|
* @return void
|
|
*/
|
|
public function delete(AccessTokenEntity $token);
|
|
}
|