Token

Token model

Parse Token issued by the IAMClient and provide some helper functions

internal
package

NextEvent\PHPSDK\Service

Methods

Token constructor

__construct(string $accessToken, integer $expiresIn, string $scope, string $tokenType) 

Arguments

$accessToken

string

$expiresIn

integer

seconds

$scope

string

$tokenType

string

Parse string in json format an construct token

fromString(string $str) : \NextEvent\PHPSDK\Model\Token|null
static

Arguments

$str

string

Response

\NextEvent\PHPSDK\Model\Token|null

Get the access token part

getAccessToken() : string

Response

string

Compose a string to be used as Authorizaton: header in HTTP requests

getAuthorizationHeader() : string

Response

string

Get the timestamp when the token expires

getExpiresAt() : integer

Response

integer

Unix timestamp

Get the scope(s) this token authorizes

getScope() : string

Response

string

Get the type part

getTokenType() : string

Response

string

Check whether the token has expired

isExpired() : boolean

Response

boolean

True if expired and no longer valid

Convert token to string in json format

toString() : string

Response

string