function hook_simplesamlphp_auth_account_authname_alter in simpleSAMLphp Authentication 8.3
Hook to alter the assigned authname of a pre-existing Drupal user.
Allows other modules to change the authname that is being stored when a pre-existing Drupal user account gets SAML-enabled. This is done by clicking the checkbox "Enable this user to leverage SAML authentication" upon user registration or the user edit form (given enough permissions).
For example, this allows you to pre-register Drupal accounts and store the entered email address (rather than the default username) as the authname. The SAML user with that email address as authname will then be able to login as that Drupal user.
Parameters
string $authname: The current authname that will be assigned this user (default: username).
\Drupal\user\UserInterface $account: The pre-existing Drupal user to be SAML-enabled.
1 invocation of hook_simplesamlphp_auth_account_authname_alter()
- simplesamlphp_auth_user_form_submit in ./
simplesamlphp_auth.module - Form submission handler for user_form.
File
- ./
simplesamlphp_auth.api.php, line 80 - Hooks for simpleSAMLphp Authentication module.
Code
function hook_simplesamlphp_auth_account_authname_alter(&$authname, \Drupal\user\UserInterface $account) {
$authname = $account->mail;
}