You are here

public function AuthCodeRedirectExample::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/AuthCodeRedirectExample.php, line 62

Class

AuthCodeRedirectExample
Auth Code with redirect example plugin.

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);
}