# Resource Owner Password

**URL:** <https://community.auth0.com/t/resource-owner-password/124295>\
**Category:** Get Help\
**Tags:** client-grants, management-api\
**Created:** [January 6, 2024, 3:10pm UTC](https://community.auth0.com/t/resource-owner-password/124295 "2024-01-06T15:10:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ivan.cheng](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ivan.cheng/32/49292_2.png) [@ivan.cheng](https://community.auth0.com/u/ivan.cheng)\
**Post date:** [January 6, 2024, 3:10pm UTC](https://community.auth0.com/t/resource-owner-password/124295/1 "2024-01-06T15:10:51Z")

</div>

Hello,  
I implemented to get auth0 token for the username and password.  
Here is a problem to select the DB connection.  
My BE connects only Prod DB connection.  
How can I select the DB connection by environment ?

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [January 9, 2024, 1:05am UTC](https://community.auth0.com/t/resource-owner-password/124295/3 "2024-01-09T01:05:21Z")

</div>

Hey there @ivan.cheng welcome to the community!

Most SDKs allow for specifying the `connection` param - Can you expand on your use case a bit here? The more detailed information you can provide the better!

---

<div class="post-metadata">

**Author:** ![ivan.cheng](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ivan.cheng/32/49292_2.png) [@ivan.cheng](https://community.auth0.com/u/ivan.cheng)\
**Post date:** [January 9, 2024, 5:20pm UTC](https://community.auth0.com/t/resource-owner-password/124295/4 "2024-01-09T17:20:00Z")

</div>

As I attached a screenshot to set Default Directory, if I didn’t set this field, the Resource Owner Password token get token from the Prod Database connection instead of Dev connection.

Now I need to get the token for the user of corresponded database

 ![image](https://global.discourse-cdn.com/auth0/original/3X/f/e/fe03286554bf59859145fbadc82bf932a337ce64.png)

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [January 10, 2024, 6:06pm UTC](https://community.auth0.com/t/resource-owner-password/124295/5 "2024-01-10T18:06:39Z")

</div>

Thanks for information - It sounds like you may need to look into adding realm support in order to specify the specific connection per environment when using the resource owner password flow.

> **[Resource Owner Password Flow](https://auth0.com/docs/get-started/authentication-and-authorization-flow/resource-owner-password-flow#realm-support)**
>
> Learn how the Resource Owner Password flow works and why you should use it for highly-trusted applications.

---

<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 24, 2024, 6:07pm UTC](https://community.auth0.com/t/resource-owner-password/124295/6 "2024-01-24T18:07:25Z")

</div>

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