abstract class Oauth2ClientServiceBase in OAuth2 Client 8.2
Same name and namespace in other branches
- 8.3 src/Service/Oauth2ClientServiceBase.php \Drupal\oauth2_client\Service\Oauth2ClientServiceBase
Base class for OAuth2 Client services.
Hierarchy
- class \Drupal\oauth2_client\Service\Oauth2ClientServiceBase implements Oauth2ClientServiceInterface
Expanded class hierarchy of Oauth2ClientServiceBase
1 file declares its use of Oauth2ClientServiceBase
- Oauth2ClientGrantServiceBase.php in src/
Service/ Grant/ Oauth2ClientGrantServiceBase.php
File
- src/
Service/ Oauth2ClientServiceBase.php, line 10
Namespace
Drupal\oauth2_client\ServiceView source
abstract class Oauth2ClientServiceBase implements Oauth2ClientServiceInterface {
/**
* {@inheritdoc}
*/
public function getClient($clientId) {
$clients =& drupal_static(__CLASS__ . '::' . __FUNCTION__, []);
if (!isset($clients[$clientId])) {
$definition = $this->oauth2ClientPluginManager
->getDefinition($clientId);
if (!$definition || !isset($definition['id'])) {
throw new InvalidOauth2ClientException($clientId);
}
$clients[$clientId] = $this->oauth2ClientPluginManager
->createInstance($definition['id']);
}
return $clients[$clientId];
}
/**
* {@inheritdoc}
*/
public function retrieveAccessToken($clientId) {
return $this->state
->get('oauth2_client_access_token-' . $clientId);
}
/**
* {@inheritdoc}
*/
public function clearAccessToken($clientId) {
return $this->state
->delete('oauth2_client_access_token-' . $clientId);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Oauth2ClientServiceBase:: |
public | function |
Clears the access token for the given client. Overrides Oauth2ClientServiceInterface:: |
|
Oauth2ClientServiceBase:: |
public | function |
Retrieve an OAuth2 Client Plugin. Overrides Oauth2ClientServiceInterface:: |
|
Oauth2ClientServiceBase:: |
public | function |
Retrieve an access token from the Drupal state. Overrides Oauth2ClientServiceInterface:: |