Overview

Namespaces

  • Docta
    • MercadoLibre
      • OAuth2
        • Client
  • GuzzleHttp
    • Cookie
    • Exception
    • Handler
    • Promise
    • Psr7
  • League
    • OAuth2
      • Client
        • Grant
          • Exception
        • Provider
          • Exception
        • Token
        • Tool
  • Psr
    • Http
      • Message

Classes

  • AccessToken
  • Overview
  • Namespace
  • Class
  • Download

Class AccessToken

Represents an access token.

League\OAuth2\Client\Token\AccessToken implements JsonSerializable
Namespace: League\OAuth2\Client\Token
Link: Access Token (RFC 6749, ยง1.4)
Located at src/Token/AccessToken.php
Methods summary
public
# __construct( array $options = [] )

Constructs an access token.

Constructs an access token.

Parameters

$options

An array of options returned by the service provider in the access token request. The access_token option is required.

Throws

InvalidArgumentException
if access_token is not provided in $options.
protected boolean
# isExpirationTimestamp( integer $value )

Check if a value is an expiration timestamp or second value.

Check if a value is an expiration timestamp or second value.

Parameters

$value

Returns

boolean
public string
# getToken( )

Returns the access token string of this instance.

Returns the access token string of this instance.

Returns

string
public string|null
# getRefreshToken( )

Returns the refresh token, if defined.

Returns the refresh token, if defined.

Returns

string|null
public integer|null
# getExpires( )

Returns the expiration timestamp, if defined.

Returns the expiration timestamp, if defined.

Returns

integer|null
public string|null
# getResourceOwnerId( )

Returns the resource owner identifier, if defined.

Returns the resource owner identifier, if defined.

Returns

string|null
public boolean
# hasExpired( )

Checks if this token has expired.

Checks if this token has expired.

Returns

boolean
true if the token has expired, false otherwise.

Throws

RuntimeException
if 'expires' is not set on the token.
public array
# getValues( )

Returns additional vendor values stored in the token.

Returns additional vendor values stored in the token.

Returns

array
public string
# __toString( )

Returns the token key.

Returns the token key.

Returns

string
public array
# jsonSerialize( )

Returns an array of parameters to serialize when this is serialized with json_encode().

Returns an array of parameters to serialize when this is serialized with json_encode().

Returns

array

Implementation of

JsonSerializable::jsonSerialize()
Properties summary
protected string $accessToken
#
protected integer $expires
#
protected string $refreshToken
#
protected string $resourceOwnerId
#
protected array $values
# []
MercadoLibre Provider for OAuth 2.0 Client API documentation generated by ApiGen