Auth0 Home Blog Docs

Require username for oauth users



Is there a way of entering in a username for users who’ve authenticated through an oauth connection? My use case is that I’d like to have a username I can use across my app. I’ve setup my database to require usernames. I tried to update an oauth user with a username through the management API, but I receive the error:
“Cannot update username for non-database user”

Is there a way to associate a username to any oauth users?


The username property in the user profile is reserved for database connections with Requires username enabled. It cannot be modified/set for users using a non-database connection.

If your requirement is purely to display a username on the UI, you can store a username in user_metadata, which you can then use in your frontend.