# Multiple user data stores within one single login procedure

**URL:** <https://community.auth0.com/t/multiple-user-data-stores-within-one-single-login-procedure/110074>\
**Category:** Get Help\
**Tags:** custom-database-connections, connections\
**Created:** [June 27, 2023, 2:08pm UTC](https://community.auth0.com/t/multiple-user-data-stores-within-one-single-login-procedure/110074 "2023-06-27T14:08:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![elster](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/elster/32/14596_2.png) [@elster](https://community.auth0.com/u/elster)\
**Post date:** [June 27, 2023, 2:08pm UTC](https://community.auth0.com/t/multiple-user-data-stores-within-one-single-login-procedure/110074/1 "2023-06-27T14:08:28Z")

</div>

Dear experts,

During UPW login, we want to validate username/passwords not only against the standard Username-Password-Authentication db, but also multiple external databases accessible via Web API, presenting only one single login button to the user. This is why the standard custom db concept doesn’t seem to work bc this limits the validation to one single db (the one handed over by the connection parameter). What is the best-practice approach to cover this use case? Is it possible to create some kind of callback/hook similar to the post login action scripts when the Username-Password-Authentication check fails, which calls the same login script you would configure for a custom db? Any other/better ideas?

Thanks in advance for your guidance,  
Elmar

---

<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:** [June 29, 2023, 4:00pm UTC](https://community.auth0.com/t/multiple-user-data-stores-within-one-single-login-procedure/110074/3 "2023-06-29T16:00:35Z")

</div>

Hi @elster,

Why would you need to validate the same username/password in multiple databases? It sounds like you may be working around a more standard use case.

For example, if you had multiple sets of users, you would want to separate them into different connections. You can still have a single login page.

---

<div class="post-metadata">

**Author:** ![elster](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/elster/32/14596_2.png) [@elster](https://community.auth0.com/u/elster)\
**Post date:** [July 3, 2023, 2:22pm UTC](https://community.auth0.com/t/multiple-user-data-stores-within-one-single-login-procedure/110074/4 "2023-07-03T14:22:36Z")

</div>

This is bc of compliance requirements, e.g. user data have to be stored in a DB hosted in a specific country, government, enterprise, etc…

---

<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:** [July 5, 2023, 1:27pm UTC](https://community.auth0.com/t/multiple-user-data-stores-within-one-single-login-procedure/110074/5 "2023-07-05T13:27:50Z")

</div>

I understand that you need to host the data in a specific locale to comply with data sovereignty laws (like GDPR). Auth0 provides private cloud deployments and custom databases which allow you to host data in any region you prefer.

> **[Private Cloud on AWS](https://auth0.com/docs/deploy-monitor/deploy-private-cloud/private-cloud-on-aws)**
>
> Learn about the Auth0 identity platform on AWS deployment option and its capabilities.

> **[Custom Database Connections](https://auth0.com/docs/authenticate/database-connections/custom-db)**
>
> Learn about authenticating users using your database as an identity provider.

---

<div class="post-metadata">

**Author:** ![elster](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/elster/32/14596_2.png) [@elster](https://community.auth0.com/u/elster)\
**Post date:** [July 6, 2023, 8:47am UTC](https://community.auth0.com/t/multiple-user-data-stores-within-one-single-login-procedure/110074/6 "2023-07-06T08:47:33Z")

</div>

Thanks for your answer. I know about the concept of Custom Database Connections, what is still unclear to me is how to integrate this concept without providing a separate login button on the ULP for each and every custom db?

---

<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:** [July 6, 2023, 12:31pm UTC](https://community.auth0.com/t/multiple-user-data-stores-within-one-single-login-procedure/110074/7 "2023-07-06T12:31:58Z")

</div>

Some customers will host multiple tenants in separate regions. For example, you could have an EU instance, a US instance, a South Korea instance, etc.

---

<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:** [July 26, 2023, 3:21pm UTC](https://community.auth0.com/t/multiple-user-data-stores-within-one-single-login-procedure/110074/8 "2023-07-26T15:21:53Z")

</div>

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