Auth0 Home Blog Docs

Imported user cannot be changed

auth0
management-api
#1

Hi,

We are using the default database connection and have username enabled. We uploaded users through the users-import API. When we try to change one of these imported users through the api and that user has not yet logged in, we get an exception. After the user logs in, the error does not occur anymore.

The exception that is logged during the api call is 400 Bad Request: Cannot update username for users without an username already set.

When we check that users raw json in Auth0 dashboard, we see that, when imported, the user does have a username set. We cannot find any reason that the imported user cannot be changed and why this error occurs. As it is an imported user, we first thought that this might be related to the fact that no password has been set yet. But when setting this through the Auth0 user dashboard, we still get the error. Only after the first login of the user, we can successfully change the user through the api. Also, no error is logged.

Our system that manages users and pushes them to Auth0 also creates users through the api (no import). In that case it all works fine.

Kind Regards,
Jan