You are here

public function ExternalAuth::login in External Authentication 8

Same name and namespace in other branches
  1. 2.0.x src/ExternalAuth.php \Drupal\externalauth\ExternalAuth::login()

Log a Drupal user in based on an external authname.

Parameters

string $authname: The unique, external authentication name provided by authentication provider.

string $provider: The module providing external authentication.

Return value

\Drupal\user\UserInterface|bool The logged in Drupal user.

Overrides ExternalAuthInterface::login

1 call to ExternalAuth::login()
ExternalAuth::loginRegister in src/ExternalAuth.php
Login and optionally register a Drupal user based on an external authname.

File

src/ExternalAuth.php, line 90

Class

ExternalAuth
Class ExternalAuth.

Namespace

Drupal\externalauth

Code

public function login($authname, $provider) {
  $account = $this
    ->load($authname, $provider);
  if ($account) {
    return $this
      ->userLoginFinalize($account, $authname, $provider);
  }
  return FALSE;
}