class ClientCredentialsGrantService in OAuth2 Client 8.2
Same name and namespace in other branches
- 8.3 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($clientId) {
$provider = $this
->getProvider($clientId);
try {
$accessToken = $provider
->getAccessToken('client_credentials');
$this
->storeAccessToken($clientId, $accessToken);
} catch (IdentityProviderException $e) {
// Failed to get the access token.
watchdog_exception('OAuth2 Client', $e);
}
}
/**
* {@inheritdoc}
*/
public function getGrantProvider($clientId) {
return $this
->getProvider($clientId);
}
}