AccessToken
class AccessToken
This class represents the access token response returned by the authorization server.
Properties
protected string | $value | ||
protected string | $secret | ||
protected bool | $authorized | ||
protected string | $expiry | ||
protected string | $type | ||
protected string | $refresh | ||
protected string | $scope | ||
protected IdToken|null | $id_token | ||
protected string|null | $response |
Methods
Constructs a AccessToken object from an array
Returns the access token string as issued by the authorization server.
Returns the access token secret.
Is the OAuth token is authorized? For OAuth 2.0, this value is always true.
Returns the expiration date time of the access token (format: %Y-%m-%d %H:%M:%S) calculated from the lifetime in seconds of the token.
Returns the type of token which is, typically just the string “bearer”.
Returns the refresh token which applications can use to obtain another access token when the access token will expire.
Returns the granted scope when it is different from the requested scope, such as if the user modified the scope.
Returns the OpenID token that the authorization server will return which encodes the user’s authentication information.
Returns the access token response as returned by the authorization server
Sets the access token string as issued by the authorization server.
Sets the access token secret.
Determines if the OAuth token is authorized or not.
Sets the expiration date time of the access token (format: %Y-%m-%d %H:%M:%S) calculated from the lifetime in seconds of the token.
Sets the type of token which is, typically just the string “bearer”.
Sets the refresh token which applications can use to obtain another access token when the access token will expire.
Sets the granted scope when it is different from the requested scope, such as if the user modified the scope.
Sets the OpenID token that the authorization server will return which encodes the user’s authentication information.
Sets the access token response as returned by the authorization server
Returns the access token string as issued by the authorization server.
Converts the access token to array
Details
at line 77
__construct(array $accessToken = [])
Constructs a AccessToken object from an array
at line 96
string
getValue()
Returns the access token string as issued by the authorization server.
at line 107
string
getSecret()
Returns the access token secret.
For OAuth 1.0, used for exchange, signature generation, or refreshing the access_token. Unused for other versions.
at line 117
bool
isAuthorized()
Is the OAuth token is authorized? For OAuth 2.0, this value is always true.
at line 127
string
getExpiry()
Returns the expiration date time of the access token (format: %Y-%m-%d %H:%M:%S) calculated from the lifetime in seconds of the token.
at line 136
string
getType()
Returns the type of token which is, typically just the string “bearer”.
at line 146
string
getRefresh()
Returns the refresh token which applications can use to obtain another access token when the access token will expire.
at line 156
string
getScope()
Returns the granted scope when it is different from the requested scope, such as if the user modified the scope.
at line 166
IdToken|null
getIdToken()
Returns the OpenID token that the authorization server will return which encodes the user’s authentication information.
at line 175
string|null
getResponse()
Returns the access token response as returned by the authorization server
at line 186
AccessToken
setValue(string $value)
Sets the access token string as issued by the authorization server.
at line 200
AccessToken
setSecret(string $secret)
Sets the access token secret.
For OAuth 1.0, used for exchange, signature generation, or refreshing the access_token. Unused for other versions.
at line 213
AccessToken
setAuthorized(bool $authorized)
Determines if the OAuth token is authorized or not.
For OAuth 2.0, this value is always true.
at line 226
AccessToken
setExpiry(string $expiry)
Sets the expiration date time of the access token (format: %Y-%m-%d %H:%M:%S) calculated from the lifetime in seconds of the token.
at line 238
AccessToken
setType(string $type)
Sets the type of token which is, typically just the string “bearer”.
at line 251
AccessToken
setRefresh(string $refresh)
Sets the refresh token which applications can use to obtain another access token when the access token will expire.
at line 264
AccessToken
setScope(string $scope)
Sets the granted scope when it is different from the requested scope, such as if the user modified the scope.
at line 277
AccessToken
setIdToken(IdToken|string|null $id_token)
Sets the OpenID token that the authorization server will return which encodes the user’s authentication information.
at line 295
AccessToken
setResponse(string $response)
Sets the access token response as returned by the authorization server
at line 306
string
__toString()
Returns the access token string as issued by the authorization server.
Alias of getValue
at line 315
array
toArray()
Converts the access token to array