Cheetah
All Classes Namespaces Files Functions Variables Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
OAuth2\Storage\JwtAccessToken Class Reference
Inheritance diagram for OAuth2\Storage\JwtAccessToken:
OAuth2\Storage\JwtAccessTokenInterface OAuth2\Storage\AccessTokenInterface

Public Member Functions

 __construct (PublicKeyInterface $publicKeyStorage, AccessTokenInterface $tokenStorage=null, EncryptionInterface $encryptionUtil=null)
 
 getAccessToken ($oauth_token)
 
 setAccessToken ($oauth_token, $client_id, $user_id, $expires, $scope=null)
 
 unsetAccessToken ($access_token)
 

Protected Member Functions

 convertJwtToOAuth2 ($tokenData)
 

Protected Attributes

 $publicKeyStorage
 
 $tokenStorage
 
 $encryptionUtil
 

Detailed Description

Author
Brent Shaffer <bshafs at gmail dot com>

Definition at line 12 of file JwtAccessToken.php.

Constructor & Destructor Documentation

◆ __construct()

OAuth2\Storage\JwtAccessToken::__construct ( PublicKeyInterface  $publicKeyStorage,
AccessTokenInterface  $tokenStorage = null,
EncryptionInterface  $encryptionUtil = null 
)
Parameters
OAuth2\Encryption\PublicKeyInterface$publicKeyStoragethe public key encryption to use
OAuth2\Storage\AccessTokenInterface$tokenStorageOPTIONAL persist the access token to another storage. This is useful if you want to retain access token grant information somewhere, but is not necessary when using this grant type.
OAuth2\Encryption\EncryptionInterface$encryptionUtilOPTIONAL class to use for "encode" and "decode" functions.

Definition at line 25 of file JwtAccessToken.php.

Member Function Documentation

◆ convertJwtToOAuth2()

OAuth2\Storage\JwtAccessToken::convertJwtToOAuth2 (   $tokenData)
protected

Definition at line 71 of file JwtAccessToken.php.

◆ getAccessToken()

OAuth2\Storage\JwtAccessToken::getAccessToken (   $oauth_token)

Look up the supplied oauth_token from storage.

We need to retrieve access token data as we create and verify tokens.

Parameters
$oauth_tokenoauth_token to be check with.
Returns
An associative array as below, and return NULL if the supplied oauth_token is invalid:
  • expires: Stored expiration in unix timestamp.
  • client_id: (optional) Stored client identifier.
  • user_id: (optional) Stored user identifier.
  • scope: (optional) Stored scope values in space-separated string.
  • id_token: (optional) Stored id_token (if "use_openid_connect" is true).

Implements OAuth2\Storage\AccessTokenInterface.

Definition at line 35 of file JwtAccessToken.php.

◆ setAccessToken()

OAuth2\Storage\JwtAccessToken::setAccessToken (   $oauth_token,
  $client_id,
  $user_id,
  $expires,
  $scope = null 
)

Store the supplied access token values to storage.

We need to store access token data as we create and verify tokens.

Parameters
$oauth_tokenoauth_token to be stored.
$client_idclient identifier to be stored.
$user_iduser identifier to be stored.
int$expiresexpiration to be stored as a Unix timestamp.
string$scopeOPTIONAL Scopes to be stored in space-separated string.

Implements OAuth2\Storage\AccessTokenInterface.

Definition at line 55 of file JwtAccessToken.php.

◆ unsetAccessToken()

OAuth2\Storage\JwtAccessToken::unsetAccessToken (   $access_token)

Definition at line 62 of file JwtAccessToken.php.

Member Data Documentation

◆ $encryptionUtil

OAuth2\Storage\JwtAccessToken::$encryptionUtil
protected

Definition at line 16 of file JwtAccessToken.php.

◆ $publicKeyStorage

OAuth2\Storage\JwtAccessToken::$publicKeyStorage
protected

Definition at line 14 of file JwtAccessToken.php.

◆ $tokenStorage

OAuth2\Storage\JwtAccessToken::$tokenStorage
protected

Definition at line 15 of file JwtAccessToken.php.


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