Account name is being set incorrectly

Created on 14 March 2023, almost 2 years ago
Updated 21 March 2023, over 1 year ago

Hello, I'm hoping someone can help me troubleshoot an issue with registering new users via simplesamlphp_auth. Until recently, everything was behaving correctly: a user would log in via simplesamlphp_auth, and if not in our Drupal DB yet, would get created via data passed to External Authentication. Now about 2 out of every 3 users who register this way get a bad account username created.

Example, if the username is janedoe, the account created might be "simplesamlphp_auth_janedoe." I can see in the Drupal\externalauth\ExternalAuth register function:

if (!empty($account_data['name'])) {
      $username = $account_data['name'];
      unset($account_data['name']);
    }
    else {
      $username = $provider . '_' . $authname;
    }

This looks like simplesaml is not providing an $account_data['name'] and falls back to using the provider+'_authname"

However, like I said, it works correctly 2/3 of the time and basically EVERY time up until a couple of weeks ago.

Any help in troubleshooting this is appreciated. I wonder if one of the identity provider servers is just slow to reply. Would that explain anything? I'm thinking that the register function is called by simplesamlphp_auth before we have all the attributes. I realize this may be completely wrong but I'm looking for any ideas. Thanks.

πŸ’¬ Support request
Status

Active

Version

2.0

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States dmudie

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @dmudie
  • πŸ‡ΊπŸ‡ΈUnited States dmudie

    Some additional info if anybody encounters this in the future. I think our hook_entity_insert from our custom module is causing an error in some cases and messing up the entity (in this case a new user). I say "some cases" because in our case we have a pool of servers that were not set up correctly. Namely, some recently added servers did not have access to an Oracle server that we hit at user creation time. When I take the entity_insert out of the equation, accounts are formed as normal.

Production build 0.71.5 2024