public function ExternalAuth::load in External Authentication 8
Same name and namespace in other branches
- 2.0.x src/ExternalAuth.php \Drupal\externalauth\ExternalAuth::load()
Load a Drupal user based on an external authname.
D7 equivalent: user_external_load().
Parameters
string $authname: The unique, external authentication name provided by authentication provider.
string $provider: The module providing external authentication.
Return value
\Drupal\user\UserInterface The loaded Drupal user.
Overrides ExternalAuthInterface::load
1 call to ExternalAuth::load()
- ExternalAuth::login in src/
ExternalAuth.php - Log a Drupal user in based on an external authname.
File
- src/
ExternalAuth.php, line 80
Class
- ExternalAuth
- Class ExternalAuth.
Namespace
Drupal\externalauthCode
public function load($authname, $provider) {
if ($uid = $this->authmap
->getUid($authname, $provider)) {
return $this->entityTypeManager
->getStorage('user')
->load($uid);
}
return FALSE;
}