Unable to find the username in the field username

When attempting to use the update by id endpoint providing anything in the password field results in 400 Bad Request: Unable to find the username in the field username so I figured the username field was required but that just gives 400 Bad Request: Cannot update username and password simultaneously.

So how does one reset a users password?

Which API endpoint are you using?

The Management API via https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id works fine like this, using the user_id and then just the new password in the body:

Figured it out, it was an issue with the query. I was using page and per_page to limit the results to 1 however for a number of the emails there are duplicate accounts stored in both ldap and auth0’s database service, the API was returning ldap users first and as such the UID was pointing at the wrong entity when trying to perform the patch. Thankfully the connection parameter will get around this.

Perhaps the error could be more helpful, either state uid does not exist in connection x, or that you cannot update ldap user credentials.

2 Likes

Perfect! Glad to hear that and thanks for sharing the feedback!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.