public function AuthenticationSubscriber::onKernelRequestAuthenticate in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/EventSubscriber/AuthenticationSubscriber.php \Drupal\Core\EventSubscriber\AuthenticationSubscriber::onKernelRequestAuthenticate()
Authenticates user on request.
Parameters
\Symfony\Component\HttpKernel\Event\GetResponseEvent $event: The request event.
See also
\Drupal\Core\Authentication\AuthenticationProviderInterface::authenticate()
File
- core/
lib/ Drupal/ Core/ EventSubscriber/ AuthenticationSubscriber.php, line 79 - Contains \Drupal\Core\EventSubscriber\AuthenticationSubscriber.
Class
- AuthenticationSubscriber
- Authentication subscriber.
Namespace
Drupal\Core\EventSubscriberCode
public function onKernelRequestAuthenticate(GetResponseEvent $event) {
if ($event
->getRequestType() === HttpKernelInterface::MASTER_REQUEST) {
$request = $event
->getRequest();
if ($this->authenticationProvider
->applies($request)) {
$account = $this->authenticationProvider
->authenticate($request);
if ($account) {
$this->accountProxy
->setAccount($account);
}
}
}
}