You are here

public function Oauth2ClientServiceBase::retrieveAccessToken in OAuth2 Client 8.2

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

Retrieve an access token from the Drupal state.

Parameters

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

Return value

\League\OAuth2\Client\Token\AccessTokenInterface The Access Token for the given client ID.

Overrides Oauth2ClientServiceInterface::retrieveAccessToken

4 calls to Oauth2ClientServiceBase::retrieveAccessToken()
Oauth2ClientService::getAccessToken in src/Service/Oauth2ClientService.php
Oauth2ClientService::getAuthorizationCodeAccessToken in src/Service/Oauth2ClientService.php
Retrieves an access token for the 'authorization_code' grant type.
Oauth2ClientService::getClientCredentialsAccessToken in src/Service/Oauth2ClientService.php
Retrieves an access token for the 'client_credentials' grant type.
Oauth2ClientService::getResourceOwnersCredentialsAccessToken in src/Service/Oauth2ClientService.php
Retrieves an access token for the 'resource_owner' grant type.

File

src/Service/Oauth2ClientServiceBase.php, line 32

Class

Oauth2ClientServiceBase
Base class for OAuth2 Client services.

Namespace

Drupal\oauth2_client\Service

Code

public function retrieveAccessToken($clientId) {
  return $this->state
    ->get('oauth2_client_access_token-' . $clientId);
}