Randomly generated username when logging through OpenID #107

Closed
opened 2025-11-01 20:47:13 -05:00 by GiteaMirror · 10 comments
Owner

Originally created by @thelicato on GitHub (Nov 14, 2022).

Description

When a user logs in using OpenID a randomly generated username is used for that user in the DB. The ideal workflow should be something like the following:

  1. User logs in using OpenID
  2. If the email succeeds and the email address is not in the DB ask the user what username he wants
  3. Complete login

Currently I'm manually changing the usernames of every user using the CLI, but this is not very handy.

Vikunja Frontend Version

0.20.1

Vikunja API Version

0.20.1

Browser and version

Chrome Version 107.0.5304.110 (Official Build) (64-bit)

Can you reproduce the bug on the Vikunja demo site?

No

Screenshots

No response

Originally created by @thelicato on GitHub (Nov 14, 2022). ### Description When a user logs in using OpenID a **randomly generated** username is used for that user in the DB. The ideal workflow should be something like the following: 1. User logs in using OpenID 2. If the email succeeds and the email address is not in the DB ask the user what username he wants 3. Complete login Currently I'm manually changing the usernames of every user using the CLI, but this is not very handy. ### Vikunja Frontend Version 0.20.1 ### Vikunja API Version 0.20.1 ### Browser and version Chrome Version 107.0.5304.110 (Official Build) (64-bit) ### Can you reproduce the bug on the Vikunja demo site? No ### Screenshots _No response_
Author
Owner

@kolaente commented on GitHub (Nov 14, 2022):

I don't think that's a good idea. It makes the sign in process too complicated when having an openid provider is generally used to make things easier.

In openid there's a concept of a "preferred username" where the provider tells the client what username the authenticated user would like to get. If the provider is configured correctly and the username is available on Vikunja it will use it.

Why do you want to change the username in the first place?

@kolaente commented on GitHub (Nov 14, 2022): I don't think that's a good idea. It makes the sign in process too complicated when having an openid provider is generally used to make things easier. In openid there's a concept of a "preferred username" where the provider tells the client what username the authenticated user would like to get. If the provider is configured correctly and the username is available on Vikunja it will use it. Why do you want to change the username in the first place?
Author
Owner

@thelicato commented on GitHub (Nov 15, 2022):

Having a known username is very important since the "Let other users find me when they search for my name" and "Let other users find me when they search for my email" options are both disabled by default. So when a new user logs in with OpenID I don't know how to find the new user.
Another ugly thing is that it automatically creates a workspace with that randomic username.

The user doesn't even know what it's username is, the only thing shown is the "Name", but when you try to add a new user to a namespace by default you must write the username.

In conclusion, I don't think this change would make the sign process too complicated, but that's your decision. Some alternatives could be:

  • Give the user the ability to change its username
  • Remove the username altogether
  • Flag by default both "Let other users find me when they search for my name" and "Let other users find me when they search for my email" options
@thelicato commented on GitHub (Nov 15, 2022): Having a **known username** is very important since the "_Let other users find me when they search for my name_" and "_Let other users find me when they search for my email_" options are both disabled by default. So when a new user logs in with OpenID I don't know how to find the new user. Another ugly thing is that it automatically creates a workspace with that randomic username. The user doesn't even know what it's username is, the only thing shown is the "Name", but when you try to add a new user to a namespace by default you **must** write the username. In conclusion, I don't think this change would make the sign process too complicated, but that's your decision. Some alternatives could be: - Give the user the ability to change its username - Remove the username altogether - Flag by default both "_Let other users find me when they search for my name_" and "_Let other users find me when they search for my email_" options
Author
Owner

@kolaente commented on GitHub (Nov 15, 2022):

Another ugly thing is that it automatically creates a workspace with that randomic username.

There are changes underway to how namespaces and lists work in general which involves changing this.

In conclusion, I don't think this change would make the sign process too complicated, but that's your decision.

The problem I have with that is no other provider (that I know of) does this, so this will likely be confusing for users. The solution is to configure your openID provider so that it sends the preferred username to Vikunja (that's an optional field and part of the standard).

Flag by default both "Let other users find me when they search for my name" and "Let other users find me when they search for my email" options

There is a configuration option to do exactly this: https://vikunja.io/docs/config-options/#discoverable_by_name

@kolaente commented on GitHub (Nov 15, 2022): > Another ugly thing is that it automatically creates a workspace with that randomic username. There are changes underway to how namespaces and lists work in general which involves changing this. > In conclusion, I don't think this change would make the sign process too complicated, but that's your decision. The problem I have with that is no other provider (that I know of) does this, so this will likely be confusing for users. The solution is to configure your openID provider so that it sends the preferred username to Vikunja (that's an optional field and part of the standard). > Flag by default both "Let other users find me when they search for my name" and "Let other users find me when they search for my email" options There is a configuration option to do exactly this: https://vikunja.io/docs/config-options/#discoverable_by_name
Author
Owner

@kolaente commented on GitHub (Nov 15, 2022):

Closing as there are alternatives available, please ping if you don't think they are sufficient.

@kolaente commented on GitHub (Nov 15, 2022): Closing as there are alternatives available, please ping if you don't think they are sufficient.
Author
Owner

@thelicato commented on GitHub (Nov 17, 2022):

I think a good solution could be adding a field in the Settings page that allows the user to change its own username. Maybe even a config value to enabled/disable this feature. I really don't like to use the CLI to change usernames

@thelicato commented on GitHub (Nov 17, 2022): I think a good solution could be adding a field in the _Settings_ page that allows the user to change its own username. Maybe even a config value to enabled/disable this feature. I really don't like to use the CLI to change usernames
Author
Owner

@kolaente commented on GitHub (Nov 17, 2022):

Something like a setting sounds like it could work.

@kolaente commented on GitHub (Nov 17, 2022): Something like a setting sounds like it could work.
Author
Owner

@manuelbiermann commented on GitHub (Feb 22, 2024):

In openid there's a concept of a "preferred username" where the provider tells the client what username the authenticated user would like to get. If the provider is configured correctly and the username is available on Vikunja it will use it.

I couldn't find anything on how to get this set up for Google. Can anyone please share a pointer on how to get this set up to just use firstname-lastname or alternatively just use the email?

@manuelbiermann commented on GitHub (Feb 22, 2024): > In openid there's a concept of a "preferred username" where the provider tells the client what username the authenticated user would like to get. If the provider is configured correctly and the username is available on Vikunja it will use it. I couldn't find anything on how to get this set up for Google. Can anyone please share a pointer on how to get this set up to just use firstname-lastname or alternatively just use the email?
Author
Owner

@kolaente commented on GitHub (Feb 22, 2024):

@manuelbiermann IIRC Google has no concept of usernames, hence it won't provide a "preferred username" to Vikunja?
Vikunja should sync the actual name from Google when it properly exposes it.

For general setup instructions, this might be what you're looking for: https://vikunja.io/docs/openid-example-configurations/#google--google-workspace

@kolaente commented on GitHub (Feb 22, 2024): @manuelbiermann IIRC Google has no concept of usernames, hence it won't provide a "preferred username" to Vikunja? Vikunja should sync the actual name from Google when it properly exposes it. For general setup instructions, this might be what you're looking for: https://vikunja.io/docs/openid-example-configurations/#google--google-workspace
Author
Owner

@manuelbiermann commented on GitHub (Feb 22, 2024):

Hey @kolaente, thanks for the prompt reply. Vikunja auto-generates a username when signing in the first time. I saw on the roadmap that there is a plan for creating an option in settings to allow users to adjust manually. I think this would be the easiest fix.

I tried to set up automation via n8n but realized that there is no option to update the username via the API.

@manuelbiermann commented on GitHub (Feb 22, 2024): Hey @kolaente, thanks for the prompt reply. Vikunja auto-generates a username when signing in the first time. I saw on the roadmap that there is a plan for creating an option in settings to allow users to adjust manually. I think this would be the easiest fix. I tried to set up automation via n8n but realized that there is no option to update the username via the API.
Author
Owner

@kolaente commented on GitHub (Feb 24, 2024):

Usernames are generally assumed to never change, which is why there is no option to change them.

@kolaente commented on GitHub (Feb 24, 2024): Usernames are generally assumed to never change, which is why there is no option to change them.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#107