# Is registering Users and getting user meta through Management API a bad practice?

**URL:** <https://community.auth0.com/t/is-registering-users-and-getting-user-meta-through-management-api-a-bad-practice/68672>\
**Category:** Get Help\
**Tags:** user\_metadata, api, resource-owner-passw, management-api, auth0\
**Created:** [August 27, 2021, 10:01am UTC](https://community.auth0.com/t/is-registering-users-and-getting-user-meta-through-management-api-a-bad-practice/68672 "2021-08-27T10:01:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![assadullahch](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/assadullahch/32/30268_2.png) [@assadullahch](https://community.auth0.com/u/assadullahch)\
**Post date:** [August 27, 2021, 10:01am UTC](https://community.auth0.com/t/is-registering-users-and-getting-user-meta-through-management-api-a-bad-practice/68672/1 "2021-08-27T10:01:23Z")

</div>

Hi,

We are building a MERN stack single page app.

We got the following use cases

- Registering users on our website without redirecting them to Auth0 hosted registration page and we are using **Management API** on our backend to handle user registration. In this transaction, we are also storing some additional information related to that user in `user_metadata`

- User authentication upon successful registration. So far **Resource Owner Password Flow** seems to be the best best option for us to handle the user authentication.

- Authenticating users without redirecting them to Auth0 hosted login page. After some digging, I ended up using **Resource Owner Password Flow** to handle the authentication through our backend.

I saw somewhere that **Management API** has a rate limit but as per our use case, we need to store subscription related information related to the user while creating their accounts through **Management API** and `user_metadata` is what holds that info.

Now upon authentication using **Resource Owner Password Flow** , we want to grab user `roles, permissions` and `user_metadata` in one API call. Is it possible?

Please help me out what are the best practices as per our use cases.

Thank you.

---

<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:** [August 30, 2021, 8:22pm UTC](https://community.auth0.com/t/is-registering-users-and-getting-user-meta-through-management-api-a-bad-practice/68672/3 "2021-08-30T20:22:20Z")

</div>

Hi @assadullahch

> [@assadullahch](#):
>
> Now upon authentication using **Resource Owner Password Flow** , we want to grab user `roles, permissions` and `user_metadata` in one API call. Is it possible?

As you are aware, management API rate limits will cause you issues if you are making requests for every user. Instead of fetching this information from the management API, you can add it to the token in a custom claim.

- [add roles to tokens](https://auth0.com/docs/authorization/sample-use-cases-rules-with-authorization)
- [add metadata to token](https://auth0.com/docs/scopes/sample-use-cases-scopes-and-claims#add-custom-claims-to-a-token)
- [add permissions to token with RBAC](https://auth0.com/docs/authorization/rbac/enable-role-based-access-control-for-apis)

---

<div class="post-metadata">

**Author:** ![assadullahch](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/assadullahch/32/30268_2.png) [@assadullahch](https://community.auth0.com/u/assadullahch)\
**Post date:** [August 30, 2021, 8:37pm UTC](https://community.auth0.com/t/is-registering-users-and-getting-user-meta-through-management-api-a-bad-practice/68672/4 "2021-08-30T20:37:20Z")

</div>

Thanks very much. I will look into these and get back if I got any other question.

Thanks again!

---

<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:** [August 30, 2021, 8:41pm UTC](https://community.auth0.com/t/is-registering-users-and-getting-user-meta-through-management-api-a-bad-practice/68672/5 "2021-08-30T20:41:59Z")

</div>

No problem. Great, let us know.

---

<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:** [October 13, 2021, 6:41pm UTC](https://community.auth0.com/t/is-registering-users-and-getting-user-meta-through-management-api-a-bad-practice/68672/6 "2021-10-13T18:41:29Z")

</div>

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