# ISSUE: Unexpected \`Wrong email or password\`

**URL:** <https://community.auth0.com/t/issue-unexpected-wrong-email-or-password/40233>\
**Category:** Get Help\
**Created:** [March 31, 2020, 11:41am UTC](https://community.auth0.com/t/issue-unexpected-wrong-email-or-password/40233 "2020-03-31T11:41:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![unfor19](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/unfor19/32/20182_2.png) [@unfor19](https://community.auth0.com/u/unfor19)\
**Post date:** [March 31, 2020, 11:41am UTC](https://community.auth0.com/t/issue-unexpected-wrong-email-or-password/40233/1 "2020-03-31T11:41:20Z")

</div>

Hi,

## Scenario

Created database DB1, enabled access to apps APP1 and APP2  
Created database DB2, enabled access to app APP1 only

Added users to database DB1  
Added users to database DB2 (different email addresses, **not** the same as DB1)

```bash
DB1 --> APP1 + APP2
DB2 --> APP1

```

## Issue

Attempting to login to APP1 and APP2 with users from database DB1 - everything is fine.  
Attempting to login to APP1 with users from database DB2 - I get **Wrong email or password**

I’ve made sure that database DB2 has a connection to APP1 and also did “Try Connection” on DB2, with a user from DB2, and it worked.

I really don’t know what could be the issue, any suggestions?

---

<div class="post-metadata">

**Author:** ![colin.coutts](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/colin.coutts/32/17217_2.png) [@colin.coutts](https://community.auth0.com/u/colin.coutts)\
**Post date:** [April 1, 2020, 10:48pm UTC](https://community.auth0.com/t/issue-unexpected-wrong-email-or-password/40233/2 "2020-04-01T22:48:06Z")

</div>

Hi @unfor19 and welcome to the Auth0 Community!

Are these DB connections [Custom DB’s](https://auth0.com/docs/connections/database/custom-db) or are both user stores in Auth0? In any case this is a bit difficult to diagnose just from this description, would you mind sending me a [.har](https://auth0.com/docs/troubleshoot/guides/generate-har-files) of this as well as your tenant name in a DM so I can look into this a bit more on my end?

Thanks!  
Colin

---

<div class="post-metadata">

**Author:** ![unfor19](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/unfor19/32/20182_2.png) [@unfor19](https://community.auth0.com/u/unfor19)\
**Post date:** [April 2, 2020, 9:23am UTC](https://community.auth0.com/t/issue-unexpected-wrong-email-or-password/40233/3 "2020-04-02T09:23:52Z")

</div>

Both regular databases on Auth0, not custom. Sending you `.har` and tenant ID in private.

 ![auth0-db1](https://global.discourse-cdn.com/auth0/original/3X/0/b/0b9d4d9b106180e7dec7368c8ef9044fdbf81371.png) ![auth0-db2](https://global.discourse-cdn.com/auth0/original/3X/6/b/6b65d0ac880330a73fc136ff3f5a76f87b32afb0.png)

---

<div class="post-metadata">

**Author:** ![colin.coutts](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/colin.coutts/32/17217_2.png) [@colin.coutts](https://community.auth0.com/u/colin.coutts)\
**Post date:** [April 2, 2020, 4:27pm UTC](https://community.auth0.com/t/issue-unexpected-wrong-email-or-password/40233/4 "2020-04-02T16:27:08Z")

</div>

Hi @unfor19

Thanks again for sending along that information, that gave my some clarity as to what you’re going after. The behavior you’ve recorded is to be expected as the Hosted Login Page (HLP) doesn’t scan all available database connections per login. From my testing it’ll take the first successful login connection and apply that to subsequent login attempts by different users.

Depending on your user pool you may be able to get around this by adding the `connectionResolver` option to your HLP in the options. A link to that can be found here:

> **[Select from Multiple Connection Options](https://auth0.com/docs/libraries/lock/selecting-from-multiple-connection-options?_ga=2.189825707.106362719.1585578603-1901535437.1585064702)**
>
> How to select different connection types for multiple login options with Lock V11.

However this relies on you having a way to differentiate between the separate user pools (in this example they use email domain however I don’t know how applicable that will be for your use-case). Another option to consider is to consolidate your users into one database and to differentiate your users based on Role Based Access Control ([RBAC](https://auth0.com/docs/authorization/concepts/rbac)) which gives you a much higher degree of control over what types of access your users have when interacting with your application.

Best Regards,  
Colin

---

<div class="post-metadata">

**Author:** ![unfor19](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/unfor19/32/20182_2.png) [@unfor19](https://community.auth0.com/u/unfor19)\
**Post date:** [April 5, 2020, 5:47am UTC](https://community.auth0.com/t/issue-unexpected-wrong-email-or-password/40233/5 "2020-04-05T05:47:57Z")

</div>

Hi Colin, thank you very much for the prompt reply!  
Since we’re using Auth0 as a protection to our dev+staging sites, this is an acceptable solution. I’ll apply the `connectionResolver`

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [April 6, 2020, 7:30am UTC](https://community.auth0.com/t/issue-unexpected-wrong-email-or-password/40233/6 "2020-04-06T07:30:08Z")

</div>

Glad you guys have figured it out!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [April 21, 2020, 7:40am UTC](https://community.auth0.com/t/issue-unexpected-wrong-email-or-password/40233/7 "2020-04-21T07:40:18Z")

</div>

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