Documentation

AccessToken extends SettingsContainerAbstract
in package

FinalYes

Access token implementation for any OAuth version.

Tags
see
https://datatracker.ietf.org/doc/html/rfc5849#section-2.3
see
https://datatracker.ietf.org/doc/html/rfc6749#section-1.4

// Oauth1

Table of Contents

Constants

EOL_NEVER_EXPIRES  = -9002
Denotes a token which never expires
EOL_UNKNOWN  = -9001
Denotes an unknown end of lifetime, such a token should be considered as expired.
EXPIRY_MAX  = 86400 * 365
Defines a maximum expiry period (1 year)

Properties

$accessToken  : string|null
$accessTokenSecret  : string|null
$expires  : int
$extraParams  : array<string|int, mixed>
$provider  : string
$refreshToken  : string|null
$scopes  : array<string|int, mixed>
$accessToken  : string|null
The oauth access token
$accessTokenSecret  : string|null
The access token secret (OAuth1)
$expires  : int
The token expiration date/time
$extraParams  : array<string|int, mixed>
Additional token parameters supplied by the provider
$provider  : string|null
The provider who issued this token
$refreshToken  : string|null
An optional refresh token (OAuth2)
$scopes  : array<string|int, mixed>
The scopes that are attached to this token (OAuth2)

Methods

isExpired()  : bool
Checks whether this token is expired
setExpiry()  : AccessToken
Sets the expiration for this token
set_expires()  : void
Expiry setter

Constants

EOL_NEVER_EXPIRES

Denotes a token which never expires

public mixed EOL_NEVER_EXPIRES = -9002

EOL_UNKNOWN

Denotes an unknown end of lifetime, such a token should be considered as expired.

public mixed EOL_UNKNOWN = -9001

EXPIRY_MAX

Defines a maximum expiry period (1 year)

public mixed EXPIRY_MAX = 86400 * 365

Properties

$accessTokenSecret

public string|null $accessTokenSecret

// Oauth2

$extraParams

public array<string|int, mixed> $extraParams

$refreshToken

public string|null $refreshToken

// common

$accessToken

The oauth access token

protected string|null $accessToken = null

$accessTokenSecret

The access token secret (OAuth1)

protected string|null $accessTokenSecret = null

$expires

The token expiration date/time

protected int $expires = self::EOL_UNKNOWN
Tags
todo:

change to DateInterval?

$extraParams

Additional token parameters supplied by the provider

protected array<string|int, mixed> $extraParams = []

$provider

The provider who issued this token

protected string|null $provider = null

$refreshToken

An optional refresh token (OAuth2)

protected string|null $refreshToken = null

$scopes

The scopes that are attached to this token (OAuth2)

protected array<string|int, mixed> $scopes = []

Methods

isExpired()

Checks whether this token is expired

public isExpired() : bool
Return values
bool

setExpiry()

Sets the expiration for this token

public setExpiry([int|null $expires = null ]) : AccessToken
Parameters
$expires : int|null = null
Return values
AccessToken

set_expires()

Expiry setter

protected set_expires([int|null $expires = null ]) : void
Parameters
$expires : int|null = null

        
On this page

Search results