You are here

public static function Client::loadToken in OAuth2 Client 7.2

Same name and namespace in other branches
  1. 7 oauth2_client.inc \OAuth2\Client::loadToken()

Load the token data from the storage.

Parameters

$key: The token identifier.

Return value

array The token data stored for the given key, or an empty token if such a key does not exist.

4 calls to Client::loadToken()
Client::clearToken in src/Client.php
Clear the token data.
Client::__construct in src/Client.php
Construct an OAuth2\Client object.
oauth2_client_get_token in ./oauth2_client.module
Returns the access token of the oauth2_client with the given $id.
oauth2_client_get_token in ./oauth2_client.api.php
Returns the access token of the oauth2_client for the given $client_id.

File

src/Client.php, line 145
Class OAuth2\Client.

Class

Client
The class OAuth2\Client is used to communicate with an oauth2 server.

Namespace

OAuth2

Code

public static function loadToken($key) {
  if (isset($_SESSION['oauth2_client']['token'][$key])) {
    return $_SESSION['oauth2_client']['token'][$key];
  }
  else {
    return static::emptyToken();
  }
}