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

59 lines
1.6 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
2014-01-16 16:50:16 +00:00
* @return \League\OAuth2\Server\Entity\AccessToken
2014-01-08 16:15:29 +00:00
*/
2014-01-10 12:30:13 +00:00
public function get($token);
public function getByRefreshToken($refreshToken);
2013-12-24 17:02:34 +00:00
2014-01-08 16:15:29 +00:00
/**
* Get the scopes for an access token
* @param string $token The access token
2014-01-16 16:50:16 +00:00
* @return array Array of \League\OAuth2\Server\Entity\Scope
2014-01-08 16:15:29 +00:00
*/
2014-01-10 12:30:13 +00:00
public function getScopes($token);
2013-12-24 17:02:34 +00:00
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
2014-01-16 16:50:16 +00:00
* @return \League\OAuth2\Server\Entity\AccessToken
2014-01-08 16:15:29 +00:00
*/
2014-01-10 12:30:13 +00:00
public function create($token, $expireTime, $sessionId);
2013-12-24 17:02:34 +00:00
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
}