function AuthenticationManager::getChallenger

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

Returns the ID of the challenge provider for a request.

Parameters

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

Return value

string|null The ID of the first authentication provider which applies to the request. If no application detects appropriate credentials, then NULL is returned.

1 call to AuthenticationManager::getChallenger()
AuthenticationManager::challengeException in core/lib/Drupal/Core/Authentication/AuthenticationManager.php
Constructs an exception which is used to generate the challenge.

File

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

Class

AuthenticationManager
Manager for authentication.

Namespace

Drupal\Core\Authentication

Code

protected function getChallenger(Request $request) {
    foreach ($this->authCollector
        ->getSortedProviders() as $provider_id => $provider) {
        if ($provider instanceof AuthenticationProviderChallengeInterface && !$provider->applies($request) && $this->applyFilter($request, FALSE, $provider_id)) {
            return $provider_id;
        }
    }
}

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