public function Oauth2GrantManager::__construct in Simple OAuth (OAuth2) & OpenID Connect 8.2
Same name and namespace in other branches
- 8.4 src/Plugin/Oauth2GrantManager.php \Drupal\simple_oauth\Plugin\Oauth2GrantManager::__construct()
- 8.3 src/Plugin/Oauth2GrantManager.php \Drupal\simple_oauth\Plugin\Oauth2GrantManager::__construct()
- 5.x src/Plugin/Oauth2GrantManager.php \Drupal\simple_oauth\Plugin\Oauth2GrantManager::__construct()
Constructor for Oauth2GrantManager objects.
Parameters
\Traversable $namespaces: An object that implements \Traversable which contains the root paths keyed by the corresponding namespace to look for plugin implementations.
\Drupal\Core\Cache\CacheBackendInterface $cache_backend: Cache backend instance to use.
\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler to invoke the alter hook with.
Overrides DefaultPluginManager::__construct
File
- src/
Plugin/ Oauth2GrantManager.php, line 71
Class
- Oauth2GrantManager
- Provides the OAuth2 Grant plugin manager.
Namespace
Drupal\simple_oauth\PluginCode
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, ClientRepositoryInterface $client_repository, ScopeRepositoryInterface $scope_repository, AccessTokenRepositoryInterface $access_token_repository, RefreshTokenRepositoryInterface $refresh_token_repository, ConfigFactoryInterface $config_factory) {
parent::__construct('Plugin/Oauth2Grant', $namespaces, $module_handler, 'Drupal\\simple_oauth\\Plugin\\Oauth2GrantInterface', 'Drupal\\simple_oauth\\Annotation\\Oauth2Grant');
$this
->alterInfo('simple_oauth_oauth2_grant_info');
$this
->setCacheBackend($cache_backend, 'simple_oauth_oauth2_grant_plugins');
$this->clientRepository = $client_repository;
$this->scopeRepository = $scope_repository;
$this->accessTokenRepository = $access_token_repository;
$this->refreshTokenRepository = $refresh_token_repository;
$settings = $config_factory
->get('simple_oauth.settings');
$this
->setKeyPaths($settings);
$this->expiration = new \DateInterval(sprintf('PT%dS', $settings
->get('access_token_expiration')));
}