AuthenticationSubscriber::onKernelRequestFilterProvider

public AuthenticationSubscriber::onKernelRequestFilterProvider(GetResponseEvent $event)

Denies access if authentication provider is not allowed on this route.

Parameters

\Symfony\Component\HttpKernel\Event\GetResponseEvent $event: The request event.

File

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

Class

AuthenticationSubscriber
Authentication subscriber.

Namespace

Drupal\Core\EventSubscriber

Code

public function onKernelRequestFilterProvider(GetResponseEvent $event) {
  if (isset($this->filter) && $event->getRequestType() === HttpKernelInterface::MASTER_REQUEST) {
    $request = $event->getRequest();
    if ($this->authenticationProvider->applies($request) && !$this->filter->appliesToRoutedRequest($request, TRUE)) {
      throw new AccessDeniedHttpException();
    }
  }
}
doc_Drupal
2016-10-29 08:45:16
Comments
Leave a Comment

Please login to continue.