Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User registration blocked when username already taken (despite Localpart template not being enforced) #3592

Open
kieranlane opened this issue Nov 28, 2024 · 0 comments

Comments

@kieranlane
Copy link

Describe the bug
When a user logs into MAS with their Identity Provider for the first time, they are presented with a screen to create their MXID. These can be enforced by, for example, a LocalPart template - which prevents a user from changing the value grabbed from the IDP.

If a user whose LocalPart template conflicts with an already registered account, a User Exists error appears.

However, this error also occurs despite no LocalPart template being enforced. MAS receives a suggested localpart from the IDP, it conflicts and the error is displayed.

If this happens to a user, and no LocalPart is being enforced, the user should be presented with the screen to create their MXID and a warning noting that the suggested LocalPart is already taken.

To Reproduce
Steps to reproduce the behavior:

  1. Setup Keycloak with two users (i.e. adrian.costello and akira.mcgee)
  2. Configure MAS with Keycloak, do not configure a LocalPart template
  3. Go to deployed Element Web, get taken to MAS, Sign in as adrian.costello via Keycloak.
  4. Change the suggested localpart/username from adrian.costello to akira.mcgee and complete account creation
  5. Sign out of adrian.costello in Keycloak (or clear cache / different browser / etc.)
  6. Go to deployed Element Web, get taken to MAS, Sign in as akira.mcgee via Keycloak.
  7. You will be presented with an error as the suggested localpart akira.mcgee is already taken - despite no enforcement of the localpart, so in theory you should be able to select something different

Expected behavior
When a user is presented with an error due to the IDP providing a value that conflicts with another / existing user, if that value isn't enforced (like via a LocalPart template), then the user should still be presented with the screen to create their MXID, but with an error indicating which fields should be changed due to conflict.

Screenshots

image
image

@kieranlane kieranlane changed the title User registration block when username already taken (despite Localpart template not being enforced) User registration blocked when username already taken (despite Localpart template not being enforced) Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant