# /usernamepassword/login 401 error

**URL:** <https://community.auth0.com/t/usernamepassword-login-401-error/70327>\
**Category:** Get Help\
**Created:** [September 27, 2021, 5:09pm UTC](https://community.auth0.com/t/usernamepassword-login-401-error/70327 "2021-09-27T17:09:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcel3](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marcel3/32/31875_2.png) [@marcel3](https://community.auth0.com/u/marcel3)\
**Post date:** [September 27, 2021, 5:09pm UTC](https://community.auth0.com/t/usernamepassword-login-401-error/70327/1 "2021-09-27T17:09:39Z")

</div>

When all my users try to log in, we get blank error, on inspect i get [https://domain-url/usernamepassword/login](https://domain-url/usernamepassword/login) 401 error. Can someone help? has anyone faced this before, and what was your solution?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [September 27, 2021, 8:01pm UTC](https://community.auth0.com/t/usernamepassword-login-401-error/70327/3 "2021-09-27T20:01:10Z")

</div>

Hi @marcel3,

Thanks for reaching out to the Auth0 Community!

I understand that your end users are encountering errors logging in.

To help me better understand what is going on, could you please share a [HAR File capture](https://auth0.com/docs/troubleshoot/generate-and-analyze-har-files) of the authentication flow and send it over as a direct message? Please be sure to select “Preserve log” to catch redirects and scrub the file of user passwords before sending.

Thank you.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [September 27, 2021, 10:18pm UTC](https://community.auth0.com/t/usernamepassword-login-401-error/70327/4 "2021-09-27T22:18:18Z")

</div>

Hi @marcel3,

After looking at your HAR file, I found the authentication flow failing because the user could not verify the CAPTCHA challenge correctly.

The POST request call to the [/usernamepassword/challenge](https://auth0.github.io/auth0.js/Authentication.html#getChallenge) endpoint returns a CAPTCHA which the user logging in needs to verify correctly to authenticate. When failing to verify the CAPTCHA correctly, the user will get a 401 status code error.

For now, I recommend that you disable Bot Detection in your [Auth0 Attack Protection Settings](https://manage.auth0.com/#/security/attack-protection/bot-detection) by setting the **Enable CAPTCHA** option to **Never**.

Doing so will allow these users to log in. I’d like to emphasize that while it is okay to disable Bot Detection for testing, it is preferred to re-enable Bot Detection for production.

Please let me know if there are any questions.

Thank you.

---

<div class="post-metadata">

**Author:** ![marcel3](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marcel3/32/31875_2.png) [@marcel3](https://community.auth0.com/u/marcel3)\
**Post date:** [September 28, 2021, 8:38am UTC](https://community.auth0.com/t/usernamepassword-login-401-error/70327/5 "2021-09-28T08:38:39Z")

</div>

I checked our auth0 dashboard and the **Enable CAPTCHA** option is set to **Never** but still getting the error. Kindly also note that the login page is the one provided by auth0 so can’t debug much from my end. Would you know what else would be the problem

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [September 28, 2021, 8:56pm UTC](https://community.auth0.com/t/usernamepassword-login-401-error/70327/6 "2021-09-28T20:56:44Z")

</div>

Hi @marcel3,

I have done a deeper investigation and discovered a couple of things that may be the source of the issue.

First, I noticed that your Universal Login Page authenticates the user against the Username-Password-Authentication Database Connection:

```auto
var databaseConnection = 'Username-Password-Authentication';

```

Because of this, any user not in this database will not be able to log in to your application.

Second, I found that your Username-Password-Authentication Database Connection has enabled **Custom Database** without implementing any of the Database Action Scripts.

I am not sure if you mean to use a Custom Database with the Username-Password-Authentication Database Connection. And if you do intend to use one, there are no scripts implemented.

You might want to either disable the **Custom Database** option or implement the Database Action Scripts. Doing so should prevent any conflicts in the future with users logging in with the Username-Password-Authentication connection.

Please let me know if this resolves the issue.

Thank you.

---

<div class="post-metadata">

**Author:** ![Jaydeeps03](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jaydeeps03/32/36419_2.png) [@Jaydeeps03](https://community.auth0.com/u/Jaydeeps03)\
**Post date:** [August 1, 2022, 11:29am UTC](https://community.auth0.com/t/usernamepassword-login-401-error/70327/7 "2022-08-01T11:29:30Z")

</div>

Hi @marcel3,  
were you able to resolve this error?  
I am also getting same error but it started after upgrading to ‘New universal login’ page.

Thanks
