Cannot change username with SSO enabled

When renaming a user (from jb1 to jb), I get this error message:
There was an error changing your username.

No information is recorded in /logs.
The old username was created because the user used SSO for the first time, and his name was too short. Now, I changed the minimum username length, and wanted to adjust his name.

1 „Gefällt mir“

what happens when you rename to jb2 … jx ?

Almost certainly a length restriction. Unlikely to be a bug.

Is there any setting for length restrictions apart from min username length, which I have set to 2?
Setting any other name does not work either.

Changing username minimum after the fact (e.g. setting minimum username length to 4 chars, when you have ten users with 2 char usernames) will cause lots of problems.

1 „Gefällt mir“

what happens if you restart your container, maybe something bad is cached?

I restarted (or in fact: rebuild) the container, this did not help.

I found it: sso overrides username prevents the name change.

I still consider this situation a bug. Enabling this setting should either hide the Change Username button from the administrator panel and disable the users/.../preferences/username page, or still allow username changes for admins (possibly with a warning).
I’d prefer the latter, to allow admins to manually “untangle” cases where Discourse’s change-illegal-names-system has created unintended names.

6 „Gefällt mir“

This PR adds test cases for the problem described in the OP, so we can be sure that in general overriding username, for example, from jb1 to jb works:

I’m going to take a look at it.

6 „Gefällt mir“

Turned out it’s already fixed. We hide this pencil when the setting is turned on:

Screenshot 2021-12-29 at 22.05.33

Also, we show this if an admin is trying to change username of some user:

3 „Gefällt mir“

This topic was automatically closed after 5 days. New replies are no longer allowed.