You are here

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

Class

ResourceOwnerExample
Resource Owner example plugin.

Namespace

Drupal\oauth2_client_example_plugins\Plugin\Oauth2Client

Code

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