You are here

public function Auth0::setAccessToken in Auth0 Single Sign On 8.2

Sets and persists the access token.

Parameters

string $accessToken - access token returned from the code exchange.:

Return value

\Auth0\SDK\Auth0

2 calls to Auth0::setAccessToken()
Auth0::exchange in vendor/auth0/auth0-php/src/Auth0.php
Exchange authorization code for access, ID, and refresh tokens
Auth0::renewTokens in vendor/auth0/auth0-php/src/Auth0.php
Renews the access token and ID token using an existing refresh token. Scope "offline_access" must be declared in order to obtain refresh token for later token renewal.

File

vendor/auth0/auth0-php/src/Auth0.php, line 649

Class

Auth0
Class Auth0 Provides access to Auth0 authentication functionality.

Namespace

Auth0\SDK

Code

public function setAccessToken($accessToken) {
  if (in_array('access_token', $this->persistantMap)) {
    $this->store
      ->set('access_token', $accessToken);
  }
  $this->accessToken = $accessToken;
  return $this;
}