Same name and namespace in other branches
- 8.9.x core/lib/Drupal/Core/EventSubscriber/AuthenticationSubscriber.php \Drupal\Core\EventSubscriber\AuthenticationSubscriber::onKernelRequestFilterProvider()
- 9 core/lib/Drupal/Core/EventSubscriber/AuthenticationSubscriber.php \Drupal\Core\EventSubscriber\AuthenticationSubscriber::onKernelRequestFilterProvider()
Denies access if authentication provider is not allowed on this route.
Parameters
\Symfony\Component\HttpKernel\Event\RequestEvent $event: The request event.
File
- core/
lib/ Drupal/ Core/ EventSubscriber/ AuthenticationSubscriber.php, line 92
Class
- AuthenticationSubscriber
- Authentication subscriber.
Namespace
Drupal\Core\EventSubscriberCode
public function onKernelRequestFilterProvider(RequestEvent $event) {
if (isset($this->filter) && $event
->isMainRequest()) {
$request = $event
->getRequest();
if ($this->authenticationProvider
->applies($request) && !$this->filter
->appliesToRoutedRequest($request, TRUE)) {
throw new AccessDeniedHttpException('The used authentication method is not allowed on this route.');
}
}
}