# Getting "Wrong email or password." when trying to login to second connection

**URL:** <https://community.auth0.com/t/getting-wrong-email-or-password-when-trying-to-login-to-second-connection/73815>\
**Category:** Get Help\
**Tags:** login\
**Created:** [November 26, 2021, 1:23pm UTC](https://community.auth0.com/t/getting-wrong-email-or-password-when-trying-to-login-to-second-connection/73815 "2021-11-26T13:23:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pieter.slabbert](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pieter.slabbert/32/14660_2.png) [@pieter.slabbert](https://community.auth0.com/u/pieter.slabbert)\
**Post date:** [November 26, 2021, 1:23pm UTC](https://community.auth0.com/t/getting-wrong-email-or-password-when-trying-to-login-to-second-connection/73815/1 "2021-11-26T13:23:15Z")

</div>

I have set up two databases both default Auth0 connections. I can create users in both databases, but when I try to login as a user in the second database via the API I get the “Wrong email or password” error. If I try the connection from the dashboard I can login just fine.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [December 1, 2021, 6:58pm UTC](https://community.auth0.com/t/getting-wrong-email-or-password-when-trying-to-login-to-second-connection/73815/3 "2021-12-01T18:58:26Z")

</div>

Hi @pieter.slabbert,

Welcome to the Community!

How are you logging in as a user in the second connection? Can you please tell us more about your setup?

---

<div class="post-metadata">

**Author:** ![pieter.slabbert](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pieter.slabbert/32/14660_2.png) [@pieter.slabbert](https://community.auth0.com/u/pieter.slabbert)\
**Post date:** [December 7, 2021, 8:35am UTC](https://community.auth0.com/t/getting-wrong-email-or-password-when-trying-to-login-to-second-connection/73815/4 "2021-12-07T08:35:02Z")

</div>

We have an application that we provide as a white-label to other companies. Each companies user pool must be distinct. At the moment each company is modeled as a Machine to Machine client and a connection. Though we want to move to a single client using multiple connections.

We are using the `/oauth/token` endpoint to login. Each client only has access to its own connection. I was expecting that with this setup, it would automatically use the connection from the relevant client.

I have found a work around for this at the moment by passing `"grant_type": "http://auth0.com/oauth/grant-type/password-realm"` and `"realm": "relevant-connection"`

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [December 7, 2021, 4:38pm UTC](https://community.auth0.com/t/getting-wrong-email-or-password-when-trying-to-login-to-second-connection/73815/5 "2021-12-07T16:38:27Z")

</div>

Thanks for the update. In the case where you would like to exchange a username/password pair directly for a token, and you would like the option to select from multiple directories/connections, you will need to use the Resource Owner Password Grant with Realm Support (as you have found).

Let me know if you have any other questions.

---

<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:** [January 20, 2022, 11:07pm UTC](https://community.auth0.com/t/getting-wrong-email-or-password-when-trying-to-login-to-second-connection/73815/6 "2022-01-20T23:07:22Z")

</div>

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