# App still using default DB to sign in

**URL:** <https://community.auth0.com/t/app-still-using-default-db-to-sign-in/183399>\
**Category:** Get Help\
**Tags:** users, management-api\
**Created:** [March 5, 2025, 4:15pm UTC](https://community.auth0.com/t/app-still-using-default-db-to-sign-in/183399 "2025-03-05T16:15:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jfurnish2](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jfurnish2/32/62356_2.png) [@jfurnish2](https://community.auth0.com/u/jfurnish2)\
**Post date:** [March 5, 2025, 4:15pm UTC](https://community.auth0.com/t/app-still-using-default-db-to-sign-in/183399/1 "2025-03-05T16:15:36Z")

</div>

Ready to post? 🔍 First, try searching for your answer.  
I have two applications within my Tenant. For one of the applications it’s using the default Username-Password-Authentication db, and the other is using a second DB I created, at least that is the intention. When I call the oath/token endpoint with the password grant type, I get an error saying that the application is not set up with the Username-Password-Authentication database. I tried specifying the “realm” in the request body as well as the connection in the request body to the new DB’s name but with no success. Any ideas what I am missing and why it is still trying to use the default database to perform the login?

---

<div class="post-metadata">

**Author:** ![gerald.czifra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gerald.czifra/32/75301_2.png) [@gerald.czifra](https://community.auth0.com/u/gerald.czifra)\
**Post date:** [March 5, 2025, 7:56pm UTC](https://community.auth0.com/t/app-still-using-default-db-to-sign-in/183399/3 "2025-03-05T19:56:27Z")

</div>

Hi @jfurnish2

Welcome to the Auth0 Community!

By default, if an application has multiple Databases enabled, Auth0 will use the user/password database connection, so unless it’s necessary to have both of them, a simple fix would be to disable the second DB from the Application.

Considering you do need both DBs enabled, you will then need to specify a criteria based on which Auth0 will authenticate the user either via one DB or the other. As you’ve mentioned using the `/oauth/token` endpoint with `password` grant type, I suspect the issue might be that you need to specify the `grant_type` as `password-realm` instead of `password`, like in the below example :

```auto
{
      "grant_type": "http://auth0.com/oauth/grant-type/password-realm",
      "client_id": "123",
      "username": "alice",
      "password": "A3ddj3w",
      "realm": "my-database-connection",
      "scope": "openid email offline_access",
      "audience": "https://api.example.com"
    }

```

More information on this can be found in our [documentation here](https://auth0.com/docs/troubleshoot/product-lifecycle/past-migrations/migration-oauthro-oauthtoken#change-requests:~:text=Here%20is%20an%20example%20of%20the%20payload%20of%20a%20request%20to%20/oauth/token%3A) and in this other [Community post](https://community.auth0.com/t/how-can-i-specify-a-database-connection-while-using-oauth-token-api-for-authentication/83604/2).

Hope this helped!  
Gerald

---

<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:** [March 19, 2025, 7:57pm UTC](https://community.auth0.com/t/app-still-using-default-db-to-sign-in/183399/4 "2025-03-19T19:57:04Z")

</div>

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