function AuthenticationManager::appliesToRoutedRequest

Same name in other branches
  1. 9 core/lib/Drupal/Core/Authentication/AuthenticationManager.php \Drupal\Core\Authentication\AuthenticationManager::appliesToRoutedRequest()
  2. 10 core/lib/Drupal/Core/Authentication/AuthenticationManager.php \Drupal\Core\Authentication\AuthenticationManager::appliesToRoutedRequest()
  3. 11.x core/lib/Drupal/Core/Authentication/AuthenticationManager.php \Drupal\Core\Authentication\AuthenticationManager::appliesToRoutedRequest()

Overrides AuthenticationProviderFilterInterface::appliesToRoutedRequest

File

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

Class

AuthenticationManager
Manager for authentication.

Namespace

Drupal\Core\Authentication

Code

public function appliesToRoutedRequest(Request $request, $authenticated) {
    $result = FALSE;
    if ($authenticated) {
        $result = $this->applyFilter($request, $authenticated, $this->getProvider($request));
    }
    else {
        foreach ($this->authCollector
            ->getSortedProviders() as $provider_id => $provider) {
            if ($this->applyFilter($request, $authenticated, $provider_id)) {
                $result = TRUE;
                break;
            }
        }
    }
    return $result;
}

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