oauth2-server/src/League/OAuth2/Server/Storage/AccessTokenInterface.php

57 lines
1.5 KiB
PHP
Raw Normal View History

2013-12-24 17:02:34 +00:00
<?php
/**
* OAuth 2.0 Access token storage interface
*
2014-01-08 16:15:29 +00:00
* @package league/oauth2-server
2013-12-24 17:02:34 +00:00
* @author Alex Bilbie <hello@alexbilbie.com>
2014-01-08 16:15:29 +00:00
* @copyright Copyright (c) PHP League of Extraordinary Packages
2013-12-24 17:02:34 +00:00
* @license http://mit-license.org/
* @link http://github.com/php-loep/oauth2-server
*/
namespace League\OAuth2\Server\Storage;
2014-01-08 16:15:29 +00:00
/**
* Access token interface
*/
2013-12-24 17:02:34 +00:00
interface AccessTokenInterface
{
2014-01-08 16:15:29 +00:00
/**
* Get an instance of Entites\AccessToken
* @param string $token The access token
* @return \League\OAuth2\Server\Entities\AccessToken
*/
2013-12-24 17:02:34 +00:00
public function getToken($token);
2014-01-08 16:15:29 +00:00
/**
* Get the scopes for an access token
* @param string $token The access token
* @return array Array of \League\OAuth2\Server\Entities\Scope
*/
2013-12-24 17:02:34 +00:00
public function getTokenScopes($token);
2014-01-08 16:15:29 +00:00
/**
* 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 \League\OAuth2\Server\Entities\AccessToken
*/
2013-12-24 17:02:34 +00:00
public function createAccessToken($token, $expireTime, $sessionId);
2014-01-08 16:15:29 +00:00
/**
* Associate a scope with an acess token
* @param string $token The access token
* @param string $scope The scope
* @return void
*/
public function associateScope($token, $scope);
/**
* Delete an access token
* @param string $token The access token to delete
* @return void
*/
public function delete($token);
2013-12-24 17:02:34 +00:00
}