Cheetah
Public Member Functions | List of all members
OAuth2\Storage\RefreshTokenInterface Interface Reference
Inheritance diagram for OAuth2\Storage\RefreshTokenInterface:
OAuth2\Storage\Cassandra OAuth2\Storage\CouchbaseDB OAuth2\Storage\DynamoDB OAuth2\Storage\Memory OAuth2\Storage\Mongo OAuth2\Storage\Pdo OAuth2\Storage\Redis

Public Member Functions

 getRefreshToken ($refresh_token)
 
 setRefreshToken ($refresh_token, $client_id, $user_id, $expires, $scope=null)
 
 unsetRefreshToken ($refresh_token)
 

Detailed Description

Implement this interface to specify where the OAuth2 Server should get/save refresh tokens for the "Refresh Token" grant type

Author
Brent Shaffer <bshafs at gmail dot com>

Definition at line 12 of file RefreshTokenInterface.php.

Member Function Documentation

◆ getRefreshToken()

OAuth2\Storage\RefreshTokenInterface::getRefreshToken (   $refresh_token)

Grant refresh access tokens.

Retrieve the stored data for the given refresh token.

Required for OAuth2::GRANT_TYPE_REFRESH_TOKEN.

Parameters
$refresh_tokenRefresh token to be check with.
Returns
An associative array as below, and NULL if the refresh_token is invalid:
  • refresh_token: Refresh token identifier.
  • client_id: Client identifier.
  • user_id: User identifier.
  • expires: Expiration unix timestamp, or 0 if the token doesn't expire.
  • scope: (optional) Scope values in space-separated string.
See also
http://tools.ietf.org/html/rfc6749#section-6

Implemented in OAuth2\Storage\Redis, OAuth2\Storage\Pdo, OAuth2\Storage\Mongo, OAuth2\Storage\Memory, OAuth2\Storage\DynamoDB, OAuth2\Storage\CouchbaseDB, and OAuth2\Storage\Cassandra.

◆ setRefreshToken()

OAuth2\Storage\RefreshTokenInterface::setRefreshToken (   $refresh_token,
  $client_id,
  $user_id,
  $expires,
  $scope = null 
)

Take the provided refresh token values and store them somewhere.

This function should be the storage counterpart to getRefreshToken().

If storage fails for some reason, we're not currently checking for any sort of success/failure, so you should bail out of the script and provide a descriptive fail message.

Required for OAuth2::GRANT_TYPE_REFRESH_TOKEN.

Parameters
$refresh_tokenRefresh token to be stored.
$client_idClient identifier to be stored.
$user_idUser identifier to be stored.
$expiresExpiration timestamp to be stored. 0 if the token doesn't expire.
$scope(optional) Scopes to be stored in space-separated string.

Implemented in OAuth2\Storage\Redis, OAuth2\Storage\Pdo, OAuth2\Storage\Mongo, OAuth2\Storage\Memory, OAuth2\Storage\DynamoDB, OAuth2\Storage\CouchbaseDB, and OAuth2\Storage\Cassandra.

◆ unsetRefreshToken()

OAuth2\Storage\RefreshTokenInterface::unsetRefreshToken (   $refresh_token)

Expire a used refresh token.

This is not explicitly required in the spec, but is almost implied. After granting a new refresh token, the old one is no longer useful and so should be forcibly expired in the data store so it can't be used again.

If storage fails for some reason, we're not currently checking for any sort of success/failure, so you should bail out of the script and provide a descriptive fail message.

Parameters
$refresh_tokenRefresh token to be expirse.

Implemented in OAuth2\Storage\Redis, OAuth2\Storage\Pdo, OAuth2\Storage\Mongo, OAuth2\Storage\Memory, OAuth2\Storage\DynamoDB, OAuth2\Storage\CouchbaseDB, and OAuth2\Storage\Cassandra.


The documentation for this interface was generated from the following file: