public function AuthenticationManager::authenticate

public AuthenticationManager::authenticate(Request $request)

Authenticates the user.

Parameters

\Symfony\Component\HttpFoundation\Request|NULL $request: The request object.

Return value

\Drupal\Core\Session\AccountInterface|NULL AccountInterface - in case of a successful authentication. NULL - in case where authentication failed.

Overrides AuthenticationProviderInterface::authenticate

File

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

Class

AuthenticationManager
Manager for authentication.

Namespace

Drupal\Core\Authentication

Code

public function authenticate(Request $request) {
  $provider_id = $this->getProvider($request);
  $provider = $this->authCollector->getProvider($provider_id);

  if ($provider) {
    return $provider->authenticate($request);
  }

  return NULL;
}

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