mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-05-31 14:12:07 +05:30
71 lines
1.8 KiB
PHP
71 lines
1.8 KiB
PHP
<?php
|
|
/**
|
|
* OAuth 2.0 Auth code 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\AuthCodeEntity;
|
|
use League\OAuth2\Server\Entity\ScopeEntity;
|
|
|
|
/**
|
|
* Auth code storage interface
|
|
*/
|
|
interface AuthCodeInterface extends StorageInterface
|
|
{
|
|
/**
|
|
* Get the auth code
|
|
*
|
|
* @param string $code
|
|
*
|
|
* @return \League\OAuth2\Server\Entity\AuthCodeEntity
|
|
*/
|
|
public function get($code);
|
|
|
|
/**
|
|
* Create an auth code.
|
|
*
|
|
* @param string $token The token ID
|
|
* @param integer $expireTime Token expire time
|
|
* @param integer $sessionId Session identifier
|
|
* @param string $redirectUri Client redirect uri
|
|
*
|
|
* @return void
|
|
*/
|
|
public function create($token, $expireTime, $sessionId, $redirectUri);
|
|
|
|
/**
|
|
* Get the scopes for an access token
|
|
*
|
|
* @param \League\OAuth2\Server\Entity\AuthCodeEntity $token The auth code
|
|
*
|
|
* @return array Array of \League\OAuth2\Server\Entity\ScopeEntity
|
|
*/
|
|
public function getScopes(AuthCodeEntity $token);
|
|
|
|
/**
|
|
* Associate a scope with an acess token
|
|
*
|
|
* @param \League\OAuth2\Server\Entity\AuthCodeEntity $token The auth code
|
|
* @param \League\OAuth2\Server\Entity\ScopeEntity $scope The scope
|
|
*
|
|
* @return void
|
|
*/
|
|
public function associateScope(AuthCodeEntity $token, ScopeEntity $scope);
|
|
|
|
/**
|
|
* Delete an access token
|
|
*
|
|
* @param \League\OAuth2\Server\Entity\AuthCodeEntity $token The access token to delete
|
|
*
|
|
* @return void
|
|
*/
|
|
public function delete(AuthCodeEntity $token);
|
|
}
|