AccessToken
extends AccessToken
in package
Represents an access token.
Table of Contents
Properties
- $accessToken : string
- $expires : int
- $idToken : mixed
- $idTokenClaims : mixed
- $refreshToken : string
- $resourceOwnerId : string
- $values : array<string|int, mixed>
Methods
- __construct() : mixed
- Constructs an access token.
- __toString() : string
- Returns a string representation of the access token
- getExpires() : int|null
- Returns the expiration timestamp in seconds, if defined.
- getIdToken() : mixed
- getIdTokenClaims() : mixed
- getRefreshToken() : string|null
- Returns the refresh token, if defined.
- getResourceOwnerId() : string|null
- Returns the resource owner identifier, if defined.
- getTimeNow() : int
- getToken() : string
- Returns the access token string of this instance.
- getValues() : array<string|int, mixed>
- Returns additional vendor values stored in the token.
- hasExpired() : bool
- Checks if this token has expired.
- jsonSerialize() : array<string|int, mixed>
- Returns an array of parameters to serialize when this is serialized with json_encode().
- resetTimeNow() : void
- Reset the time now if it was set for test purposes.
- setRefreshToken() : void
- Sets or replaces the refresh token with the provided refresh token.
- setTimeNow() : void
- Set the time now. This should only be used for testing purposes.
- isExpirationTimestamp() : bool
- Check if a value is an expiration timestamp or second value.
Properties
$accessToken
protected
string
$accessToken
$expires
protected
int
$expires
$idToken
protected
mixed
$idToken
$idTokenClaims
protected
mixed
$idTokenClaims
$refreshToken
protected
string
$refreshToken
$resourceOwnerId
protected
string
$resourceOwnerId
$values
protected
array<string|int, mixed>
$values
= []
Methods
__construct()
Constructs an access token.
public
__construct(array<string|int, mixed> $options, Azure $provider) : mixed
Parameters
- $options : array<string|int, mixed>
-
An array of options returned by the service provider in the access token request. The
access_tokenoption is required. - $provider : Azure
__toString()
Returns a string representation of the access token
public
__toString() : string
Tags
Return values
stringgetExpires()
Returns the expiration timestamp in seconds, if defined.
public
getExpires() : int|null
Tags
Return values
int|nullgetIdToken()
public
getIdToken() : mixed
getIdTokenClaims()
public
getIdTokenClaims() : mixed
getRefreshToken()
Returns the refresh token, if defined.
public
getRefreshToken() : string|null
Tags
Return values
string|nullgetResourceOwnerId()
Returns the resource owner identifier, if defined.
public
getResourceOwnerId() : string|null
Tags
Return values
string|nullgetTimeNow()
public
getTimeNow() : int
Return values
intgetToken()
Returns the access token string of this instance.
public
getToken() : string
Tags
Return values
stringgetValues()
Returns additional vendor values stored in the token.
public
getValues() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>hasExpired()
Checks if this token has expired.
public
hasExpired() : bool
Tags
Return values
bool —true if the token has expired, false otherwise.
jsonSerialize()
Returns an array of parameters to serialize when this is serialized with json_encode().
public
jsonSerialize() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>resetTimeNow()
Reset the time now if it was set for test purposes.
public
static resetTimeNow() : void
setRefreshToken()
Sets or replaces the refresh token with the provided refresh token.
public
setRefreshToken(mixed $refreshToken) : void
Parameters
- $refreshToken : mixed
Tags
setTimeNow()
Set the time now. This should only be used for testing purposes.
public
static setTimeNow(int $timeNow) : void
Parameters
- $timeNow : int
-
the time in seconds since epoch
isExpirationTimestamp()
Check if a value is an expiration timestamp or second value.
protected
isExpirationTimestamp(int $value) : bool
Parameters
- $value : int