\OAuth2\ResponseTypeJwtAccessToken

Summary

Methods
Properties
Constants
__construct()
getAuthorizeResponse()
createAccessToken()
revokeToken()
No public properties found
No constants found
generateAccessToken()
generateRefreshToken()
encodeToken()
createPayload()
$tokenStorage
$refreshStorage
$config
$publicKeyStorage
$encryptionUtil
N/A
No private methods found
No private properties found
N/A

Properties

$config

$config : array

Type

array

$publicKeyStorage

$publicKeyStorage : 

Type

$encryptionUtil

$encryptionUtil : 

Type

Methods

__construct()

__construct(\OAuth2\Storage\PublicKeyInterface  $publicKeyStorage = null, \OAuth2\Storage\AccessTokenInterface  $tokenStorage = null, \OAuth2\Storage\RefreshTokenInterface  $refreshStorage = null, array  $config = array(), \OAuth2\Encryption\EncryptionInterface  $encryptionUtil = null) 

Parameters

\OAuth2\Storage\PublicKeyInterface $publicKeyStorage

-

\OAuth2\Storage\AccessTokenInterface $tokenStorage

-

\OAuth2\Storage\RefreshTokenInterface $refreshStorage

-

array $config
  • array with key store_encrypted_token_string (bool true) whether the entire encrypted string is stored, or just the token ID is stored
\OAuth2\Encryption\EncryptionInterface $encryptionUtil

-

getAuthorizeResponse()

getAuthorizeResponse(array  $params, mixed  $user_id = null) : array

Get authorize response

Parameters

array $params
mixed $user_id

Returns

array

createAccessToken()

createAccessToken(mixed  $client_id, mixed  $user_id, string  $scope = null, boolean  $includeRefreshToken = true) : array

Handle the creation of access token, also issue refresh token if supported / desirable.

Parameters

mixed $client_id
  • Client identifier related to the access token.
mixed $user_id
  • User ID associated with the access token
string $scope
  • (optional) Scopes to be stored in space-separated string.
boolean $includeRefreshToken
  • If true, a new refresh_token will be added to the response

Returns

array —
  • The access token

revokeToken()

revokeToken(  $token, null  $tokenTypeHint = null) : boolean

Handle the revoking of refresh tokens, and access tokens if supported / desirable RFC7009 specifies that "If the server is unable to locate the token using the given hint, it MUST extend its search across all of its supported token types"

Parameters

$token
null $tokenTypeHint

Throws

\RuntimeException

Returns

boolean

generateAccessToken()

generateAccessToken() : string

Generates an unique access token.

Implementing classes may want to override this function to implement other access token generation schemes.

Returns

string —
  • A unique access token.

generateRefreshToken()

generateRefreshToken() : string

Generates an unique refresh token

Implementing classes may want to override this function to implement other refresh token generation schemes.

Returns

string —
  • A unique refresh token.

encodeToken()

encodeToken(array  $token, mixed  $client_id = null) : mixed

Parameters

array $token
mixed $client_id

Returns

mixed

createPayload()

createPayload(mixed  $client_id, mixed  $user_id, string  $scope = null) : array

This function can be used to create custom JWT payloads

Parameters

mixed $client_id
  • Client identifier related to the access token.
mixed $user_id
  • User ID associated with the access token
string $scope
  • (optional) Scopes to be stored in space-separated string.

Returns

array —
  • The access token