class ClientCredentialsGrantService in OAuth2 Client 8.3
Same name and namespace in other branches
- 8.2 src/Service/Grant/ClientCredentialsGrantService.php \Drupal\oauth2_client\Service\Grant\ClientCredentialsGrantService
Handles Authorization Grants for the OAuth2 Client module.
Hierarchy
- class \Drupal\oauth2_client\Service\Oauth2ClientServiceBase implements Oauth2ClientServiceInterface
- class \Drupal\oauth2_client\Service\Grant\Oauth2ClientGrantServiceBase implements Oauth2ClientGrantServiceInterface
- class \Drupal\oauth2_client\Service\Grant\ClientCredentialsGrantService
- class \Drupal\oauth2_client\Service\Grant\Oauth2ClientGrantServiceBase implements Oauth2ClientGrantServiceInterface
Expanded class hierarchy of ClientCredentialsGrantService
1 string reference to 'ClientCredentialsGrantService'
File
- src/
Service/ Grant/ ClientCredentialsGrantService.php, line 10
Namespace
Drupal\oauth2_client\Service\GrantView source
class ClientCredentialsGrantService extends Oauth2ClientGrantServiceBase {
/**
* {@inheritdoc}
*/
public function getAccessToken($pluginId) {
$provider = $this
->getProvider($pluginId);
try {
$accessToken = $provider
->getAccessToken('client_credentials');
$this
->storeAccessToken($pluginId, $accessToken);
} catch (IdentityProviderException $e) {
// Failed to get the access token.
watchdog_exception('OAuth2 Client', $e);
}
}
/**
* {@inheritdoc}
*/
public function getGrantProvider($pluginId) {
return $this
->getProvider($pluginId);
}
}