You are here

protected function Oauth2ClientGrantServiceBase::storeAccessToken in OAuth2 Client 8.2

Same name and namespace in other branches
  1. 8.3 src/Service/Grant/Oauth2ClientGrantServiceBase.php \Drupal\oauth2_client\Service\Grant\Oauth2ClientGrantServiceBase::storeAccessToken()

Store an access token to the Drupal state.

Parameters

string $clientId: The client for which a provider should be created.

\League\OAuth2\Client\Token\AccessToken $accessToken: The Access Token to be stored.

4 calls to Oauth2ClientGrantServiceBase::storeAccessToken()
AuthorizationCodeGrantService::getAccessToken in src/Service/Grant/AuthorizationCodeGrantService.php
Get an OAuth2 access token.
ClientCredentialsGrantService::getAccessToken in src/Service/Grant/ClientCredentialsGrantService.php
Get an OAuth2 access token.
RefreshTokenGrantService::getAccessToken in src/Service/Grant/RefreshTokenGrantService.php
Get an OAuth2 access token.
ResourceOwnersCredentialsGrantService::getAccessToken in src/Service/Grant/ResourceOwnersCredentialsGrantService.php
Get an OAuth2 access token.

File

src/Service/Grant/Oauth2ClientGrantServiceBase.php, line 119

Class

Oauth2ClientGrantServiceBase
Base class for OAuth2 Client grant services.

Namespace

Drupal\oauth2_client\Service\Grant

Code

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