\OAuth2\ResponseTypeAccessToken

Summary

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

Properties

$config

$config : array

Type

array

Methods

__construct()

__construct(\OAuth2\Storage\AccessTokenInterface  $tokenStorage, \OAuth2\Storage\RefreshTokenInterface  $refreshStorage = null, array  $config = array()) 

Parameters

\OAuth2\Storage\AccessTokenInterface $tokenStorage
  • REQUIRED Storage class for saving access token information
\OAuth2\Storage\RefreshTokenInterface $refreshStorage
  • OPTIONAL Storage class for saving refresh token information
array $config
  • OPTIONAL Configuration options for the server

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

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.