AuthToken
in package
Class AuthToken
Tags
Table of Contents
- $expiresIn : int|null
- Number of seconds in token expires
- $timeCreated : int
- Timestamp of token creation
- $token : string
- Access token
- $tokenType : string
- Token type (usually 'Bearer')
- __construct() : mixed
- AuthToken constructor.
- __toString() : string
- To string casting method
- getExpiresIn() : int|null
- Return expires in value in seconds
- getHeaderValue() : string
- String to be used as Authorization header value
- isExpired() : bool
- Is token expired?
Properties
$expiresIn
Number of seconds in token expires
protected
int|null
$expiresIn
$timeCreated
Timestamp of token creation
protected
int
$timeCreated
$token
Access token
protected
string
$token
$tokenType
Token type (usually 'Bearer')
protected
string
$tokenType
Methods
__construct()
AuthToken constructor.
public
__construct(string $token, int|null $expiresIn[, string $tokenType = 'Bearer' ]) : mixed
Parameters
- $token : string
-
Access token string
- $expiresIn : int|null
-
Expires in seconds?
- $tokenType : string = 'Bearer'
-
Type of token
Return values
mixed —__toString()
To string casting method
public
__toString() : string
Return values
string —getExpiresIn()
Return expires in value in seconds
public
getExpiresIn() : int|null
Return values
int|null —getHeaderValue()
String to be used as Authorization header value
public
getHeaderValue() : string
Return values
string —isExpired()
Is token expired?
public
isExpired() : bool