OAuth2TokenField uses ConstantsTrait
Enumeration of OAuth 2.0 / OIDC token endpoint response fields.
These constants are used as keys when decoding a successful token response (RFC 6749 §5.1) or an error response (§5.2).
Example:
$data = json_decode( $response->getBody()->getContents() , true ) ;
$this->accessToken = $data[ OAuth2TokenField::ACCESS_TOKEN ] ?? null ;
$this->tokenExpires = $now + ( $data[ OAuth2TokenField::EXPIRES_IN ] ?? 3600 ) - 60 ;
Tags
Table of Contents
Constants
- ACCESS_TOKEN : string = 'access_token'
- ACTIVE : string = 'active'
- AUD : string = 'aud'
- CLIENT_ID : string = 'client_id'
- ERROR : string = 'error'
- ERROR_DESCRIPTION : string = 'error_description'
- ERROR_URI : string = 'error_uri'
- EXP : string = 'exp'
- EXPIRES_IN : string = 'expires_in'
- IAT : string = 'iat'
- ID_TOKEN : string = 'id_token'
- ISS : string = 'iss'
- JTI : string = 'jti'
- NBF : string = 'nbf'
- REFRESH_TOKEN : string = 'refresh_token'
- SCOPE : string = 'scope'
- SUB : string = 'sub'
- TOKEN_TYPE : string = 'token_type'
- USERNAME : string = 'username'
Constants
ACCESS_TOKEN
public
string
ACCESS_TOKEN
= 'access_token'
ACTIVE
public
string
ACTIVE
= 'active'
AUD
public
string
AUD
= 'aud'
CLIENT_ID
public
string
CLIENT_ID
= 'client_id'
ERROR
public
string
ERROR
= 'error'
ERROR_DESCRIPTION
public
string
ERROR_DESCRIPTION
= 'error_description'
ERROR_URI
public
string
ERROR_URI
= 'error_uri'
EXP
public
string
EXP
= 'exp'
EXPIRES_IN
public
string
EXPIRES_IN
= 'expires_in'
IAT
public
string
IAT
= 'iat'
ID_TOKEN
public
string
ID_TOKEN
= 'id_token'
ISS
public
string
ISS
= 'iss'
JTI
public
string
JTI
= 'jti'
NBF
public
string
NBF
= 'nbf'
REFRESH_TOKEN
public
string
REFRESH_TOKEN
= 'refresh_token'
SCOPE
public
string
SCOPE
= 'scope'
SUB
public
string
SUB
= 'sub'
TOKEN_TYPE
public
string
TOKEN_TYPE
= 'token_type'
USERNAME
public
string
USERNAME
= 'username'