Problem/Motivation
When simplesamlphp_auth creates a new user via externalauth->register() it does not supply $account_data. Externalauth therefore prefixes the supplied $authname with the prefix 'simplesamlphp_auth_' and uses this value for the init and name account fields. These extra 19 letters mean that an email of length more than 41 characters will result in a DB error on externalauth's initial $account->save() since Drupal's name column in users_field_data table is limited to 60 characters. The watchdog error produced is String data, right truncated: 7 ERROR: value too long for type character varying(60): INSERT INTO "users_field_data" ....
If we could supply externalauth with the $account_data['name'] value it wants we could support longer emails.
Steps to reproduce
Attempt to register a user account with an email (and therefore name) of 42 characters, e.g. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@aaa.com.
Proposed resolution
Supply externalauth->register() with an $account_data['name'] value.
$account = $this->externalauth->register($authname, 'simplesamlphp_auth', ['name' => $authname]);
| Comment | File | Size | Author |
|---|---|---|---|
| simplesamlphp_auth.patch | 717 bytes | patrickharris |
Comments
Comment #2
patrickharris commented