AuthenticationManager::getProvider

protected AuthenticationManager::getProvider(Request $request)

Returns the id of the authentication 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 101

Class

AuthenticationManager
Manager for authentication.

Namespace

Drupal\Core\Authentication

Code

protected function getProvider(Request $request) {
  foreach ($this->authCollector->getSortedProviders() as $provider_id => $provider) {
    if ($provider->applies($request)) {
      return $provider_id;
    }
  }
}
doc_Drupal
2016-10-29 08:45:13
Comments
Leave a Comment

Please login to continue.