Problem/Motivation

When Openid Connect module want to generate username during the connexion of a not existing user, if username length is higher than limitation (USERNAME_MAX_LENGTH = 60), then a fatal error occur.

Proposed resolution

In case username generated is higher than max length, we should change it so it can exceed 60 characters.

Two options :
1/ reduce username to length < 60 and suffix by an iterative number while username is not available.
2/ crypt username to a string of 60 characters

I have a preference for 2/ which is more generic.

Comments

GoZ created an issue. See original summary.

goz’s picture

StatusFileSize
new885 bytes
nod_’s picture

StatusFileSize
new578 bytes

Solved it a different way (D8 Patch). md5 the id given back by the auth server, length is predictable that way.

pjcdawkins’s picture

Status: Active » Needs review
StatusFileSize
new2.78 KB

The rules for valid usernames are quite complex. This adds a function that sanitizes the new username according to Drupal core's rules.

sanduhrs’s picture

Status: Needs review » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.