ClientCredentialsGrantService.php in OAuth2 Client 8.3
File
src/Service/Grant/ClientCredentialsGrantService.php
View source
<?php
namespace Drupal\oauth2_client\Service\Grant;
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
class ClientCredentialsGrantService extends Oauth2ClientGrantServiceBase {
public function getAccessToken($pluginId) {
$provider = $this
->getProvider($pluginId);
try {
$accessToken = $provider
->getAccessToken('client_credentials');
$this
->storeAccessToken($pluginId, $accessToken);
} catch (IdentityProviderException $e) {
watchdog_exception('OAuth2 Client', $e);
}
}
public function getGrantProvider($pluginId) {
return $this
->getProvider($pluginId);
}
}