Cannot change username with SSO enabled

AI-generated summary

A user, fefrei, is experiencing an issue where they cannot change a username due to SSO being enabled. They receive an error message stating “There was an error changing your username.” codinghorror suggests it may be due to a length restriction. fefrei discovers the issue is caused by the setting “sso overrides username.” They consider this a bug, suggesting that the setting should either hide the “Change Username” button or allow admins to make changes with a warning. andrei finds a PR that adds test cases for this issue and later discovers (andrei) that the issue is already fixed, with the “Change Username” button being hidden when the setting is enabled, and a warning message displayed when an admin attempts to change a username.

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개의 좋아요

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개의 좋아요

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개의 좋아요

이 PR은 OP에 설명된 문제에 대한 테스트 케이스를 추가하여, 예를 들어 jb1에서 jb로 사용자 이름(Username)을 오버라이드하는 것이 일반적으로 제대로 동작하는지 확인할 수 있도록 합니다:

확인해 보겠습니다.

6개의 좋아요

결국 이미 수정되어 있었습니다. 해당 설정이 켜져 있을 때 이 연필 아이콘을 숨기도록 했습니다:

또한, 관리자가 특정 사용자의 사용자 이름을 변경하려고 할 때 다음과 같은 내용을 표시합니다:

3개의 좋아요

이 주제는 5일 후 자동으로 닫혔습니다. 더 이상 새 답변을 남길 수 없습니다.