You are here

public function AuthCodeAccessExample::storeAccessToken in OAuth2 Client 8.3

Stores access tokens obtained by this client.

Parameters

\League\OAuth2\Client\Token\AccessToken $accessToken: The token to store.

Overrides Oauth2ClientPluginInterface::storeAccessToken

File

examples/oauth2_client_example_plugins/src/Plugin/Oauth2Client/AuthCodeAccessExample.php, line 59

Class

AuthCodeAccessExample
Auth code with access example.

Namespace

Drupal\oauth2_client_example_plugins\Plugin\Oauth2Client

Code

public function storeAccessToken(AccessToken $accessToken) {
  $key = 'oauth2_client_access_token-' . $this
    ->getId();
  $this->tempStore
    ->set($key, $accessToken);
}