2013-12-24 17:02:34 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2016-02-19 18:09:39 -05:00
|
|
|
* OAuth 2.0 Access token storage interface.
|
2013-12-24 17:02:34 +00:00
|
|
|
*
|
|
|
|
* @author Alex Bilbie <hello@alexbilbie.com>
|
2014-03-09 19:34:23 +00:00
|
|
|
* @copyright Copyright (c) Alex Bilbie
|
2013-12-24 17:02:34 +00:00
|
|
|
* @license http://mit-license.org/
|
2016-02-19 18:09:39 -05:00
|
|
|
*
|
2014-03-09 20:05:38 +00:00
|
|
|
* @link https://github.com/thephpleague/oauth2-server
|
2013-12-24 17:02:34 +00:00
|
|
|
*/
|
2015-04-05 17:00:43 +01:00
|
|
|
namespace League\OAuth2\Server\Repositories;
|
2013-12-24 17:02:34 +00:00
|
|
|
|
2015-04-05 17:00:43 +01:00
|
|
|
use League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface;
|
2014-05-01 14:45:38 +01:00
|
|
|
|
2014-01-08 16:15:29 +00:00
|
|
|
/**
|
2016-02-19 18:09:39 -05:00
|
|
|
* Access token interface.
|
2014-01-08 16:15:29 +00:00
|
|
|
*/
|
2015-04-05 17:00:43 +01:00
|
|
|
interface AccessTokenRepositoryInterface extends RepositoryInterface
|
2013-12-24 17:02:34 +00:00
|
|
|
{
|
2014-01-08 16:15:29 +00:00
|
|
|
/**
|
2016-02-19 18:09:39 -05:00
|
|
|
* Persists a new access token to permanent storage.
|
2014-12-10 13:10:35 +00:00
|
|
|
*
|
2015-04-05 17:00:43 +01:00
|
|
|
* @param \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface $accessTokenEntity
|
2014-01-08 16:15:29 +00:00
|
|
|
*/
|
2015-11-13 17:39:07 +00:00
|
|
|
public function persistNewAccessToken(AccessTokenEntityInterface $accessTokenEntity);
|
2013-12-24 17:02:34 +00:00
|
|
|
|
2014-01-08 16:15:29 +00:00
|
|
|
/**
|
2016-02-19 18:09:39 -05:00
|
|
|
* Revoke an access token.
|
2014-12-10 13:10:35 +00:00
|
|
|
*
|
2016-01-12 23:52:08 +00:00
|
|
|
* @param string $tokenId
|
2014-01-08 16:15:29 +00:00
|
|
|
*/
|
2016-01-12 23:52:08 +00:00
|
|
|
public function revokeAccessToken($tokenId);
|
2014-01-08 16:15:29 +00:00
|
|
|
|
|
|
|
/**
|
2016-02-19 18:09:39 -05:00
|
|
|
* Check if the access token has been revoked.
|
2016-01-12 23:52:08 +00:00
|
|
|
*
|
|
|
|
* @param string $tokenId
|
2014-12-10 13:10:35 +00:00
|
|
|
*
|
2016-01-12 23:52:08 +00:00
|
|
|
* @return bool Return true if this token has been revoked
|
2014-01-08 16:15:29 +00:00
|
|
|
*/
|
2016-01-12 23:52:08 +00:00
|
|
|
public function isAccessTokenRevoked($tokenId);
|
2013-12-24 17:02:34 +00:00
|
|
|
}
|