function AuthenticationSubscriber::__construct

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/EventSubscriber/AuthenticationSubscriber.php \Drupal\Core\EventSubscriber\AuthenticationSubscriber::__construct()
  2. 8.9.x core/lib/Drupal/Core/EventSubscriber/AuthenticationSubscriber.php \Drupal\Core\EventSubscriber\AuthenticationSubscriber::__construct()
  3. 10 core/lib/Drupal/Core/EventSubscriber/AuthenticationSubscriber.php \Drupal\Core\EventSubscriber\AuthenticationSubscriber::__construct()

Constructs an authentication subscriber.

Parameters

\Drupal\Core\Authentication\AuthenticationProviderInterface $authentication_provider: An authentication provider.

\Drupal\Core\Session\AccountProxyInterface $account_proxy: Account proxy.

File

core/lib/Drupal/Core/EventSubscriber/AuthenticationSubscriber.php, line 58

Class

AuthenticationSubscriber
Authentication subscriber.

Namespace

Drupal\Core\EventSubscriber

Code

public function __construct(AuthenticationProviderInterface $authentication_provider, AccountProxyInterface $account_proxy) {
    $this->authenticationProvider = $authentication_provider;
    $this->filter = $authentication_provider instanceof AuthenticationProviderFilterInterface ? $authentication_provider : NULL;
    $this->challengeProvider = $authentication_provider instanceof AuthenticationProviderChallengeInterface ? $authentication_provider : NULL;
    $this->accountProxy = $account_proxy;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.