Skip to content

Duplicate key on OpenID connect #4576

Description

@klauserber

Hello, I am working on a cluster setup for devops & developer trainings. A central part of it is coder to give the participants a fancy development environment. For email based self registration I use keycloak and OIDC in coder. I don't now the email domains, so it is not possible to restrict them.

When 2 users with the same name before the @ try to register (e. g. hans@example1.com and hans@example2.com), the second user gets the error:

{"message":"Failed to process OAuth login.","detail":"in tx: execute transaction: create user: execute transaction: create user: pq: duplicate key value violates unique constraint \"idx_users_username\""}

Is it possible to configure how the names a built? May by converting hans@example2.com to hans-example2-com or similar. Or give the second user a number suffix (hans2).

Metadata

Metadata

Assignees

Labels

s0Major regression, all-hands-on-deck to fix

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions