You are here

public function AuthorizationCode::__construct in Simple OAuth (OAuth2) & OpenID Connect 8.4

Same name and namespace in other branches
  1. 5.x src/Plugin/Oauth2Grant/AuthorizationCode.php \Drupal\simple_oauth\Plugin\Oauth2Grant\AuthorizationCode::__construct()

Class constructor.

Overrides PluginBase::__construct

File

src/Plugin/Oauth2Grant/AuthorizationCode.php, line 46

Class

AuthorizationCode
The authorization code grant plugin.

Namespace

Drupal\simple_oauth\Plugin\Oauth2Grant

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, AuthCodeRepositoryInterface $auth_code_repository, RefreshTokenRepositoryInterface $refresh_token_repository, ConfigFactoryInterface $config_factory) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $settings = $config_factory
    ->get('simple_oauth.settings');
  $this->authCodeRepository = $auth_code_repository;
  $this->refreshTokenRepository = $refresh_token_repository;
  $this->authCodeExpiration = new \DateInterval(sprintf('PT%dS', $settings
    ->get('authorization_code_expiration')));
}