protected function AuthenticationManager::getChallenger

protected AuthenticationManager::getChallenger(Request $request)

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.

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;
    }
  }
}

© 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::getChallenger/8.1.x