protected function AuthenticationManager::applyFilter

protected AuthenticationManager::applyFilter(Request $request, $authenticated, $provider_id)

Checks whether a provider is allowed on the given request.

If no filter is registered for the given provider id, the default filter is applied.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The incoming request.

bool $authenticated: Whether or not the request is authenticated.

string $provider_id: The id of the authentication provider to check access for.

Return value

bool TRUE if provider is allowed, FALSE otherwise.

File

core/lib/Drupal/Core/Authentication/AuthenticationManager.php, line 143

Class

AuthenticationManager
Manager for authentication.

Namespace

Drupal\Core\Authentication

Code

protected function applyFilter(Request $request, $authenticated, $provider_id) {
  $provider = $this->authCollector->getProvider($provider_id);

  if ($provider && ($provider instanceof AuthenticationProviderFilterInterface)) {
    $result = $provider->appliesToRoutedRequest($request, $authenticated);
  }
  else {
    $result = $this->defaultFilter($request, $provider_id);
  }

  return $result;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Authentication!AuthenticationManager.php/function/AuthenticationManager::applyFilter/8.1.x