You are here

public static function ExternalAuthenticationHelper::getUserIdentifierFromMap in Lightweight Directory Access Protocol (LDAP) 8.3

Replaces the authmap table retired in Drupal 8.

Parameters

int $uid: Drupal user ID.

Return value

string Authentication name.

5 calls to ExternalAuthenticationHelper::getUserIdentifierFromMap()
DrupalUserProcessor::isUserLdapAssociated in ldap_user/src/Processor/DrupalUserProcessor.php
Test if the user is LDAP associated.
LdapUserTestForm::submitForm in ldap_user/src/Form/LdapUserTestForm.php
Form submission handler.
ldap_authentication_ldap_authenticated in ldap_authentication/ldap_authentication.module
Are we LDAP authenticated.
LoginValidator::initializeDrupalUserFromAuthName in ldap_authentication/src/Controller/LoginValidator.php
Determine if the corresponding Drupal account exists and is mapped.
ServerFactory::getUserDataFromServerByAccount in ldap_servers/src/ServerFactory.php
Fetch user data from server by user account.

File

ldap_user/src/Helper/ExternalAuthenticationHelper.php, line 57

Class

ExternalAuthenticationHelper
Helper class to wrap external_auth service.

Namespace

Drupal\ldap_user\Helper

Code

public static function getUserIdentifierFromMap($uid) {
  $authmap = \Drupal::service('externalauth.authmap');
  $authdata = $authmap
    ->getAuthdata($uid, 'ldap_user');
  if (isset($authdata['authname']) && !empty($authdata['authname'])) {
    return $authdata['authname'];
  }
}