# Get user metadata

**URL:** <https://community.auth0.com/t/get-user-metadata/109973>\
**Category:** Get Help\
**Tags:** user-profile, user-management\
**Created:** [June 26, 2023, 3:37pm UTC](https://community.auth0.com/t/get-user-metadata/109973 "2023-06-26T15:37:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gestaoconfiguracoes](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gestaoconfiguracoes/32/45730_2.png) [@gestaoconfiguracoes](https://community.auth0.com/u/gestaoconfiguracoes)\
**Post date:** [June 26, 2023, 3:37pm UTC](https://community.auth0.com/t/get-user-metadata/109973/1 "2023-06-26T15:37:31Z")

</div>

Good morning,  
I’m testing the implementation of Auth0 as SSO for my application and I’m not able to get the parameters of users/email, roles, etc. in the returned token. I created for a user. I work in a B2B model where my application is accessed by companies that have internal users with different access to my set of applications. I need this metadata to know which application and which user profile to direct a token to. How do I get this metadata?  
thanks

---

<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:** [June 26, 2023, 6:21pm UTC](https://community.auth0.com/t/get-user-metadata/109973/3 "2023-06-26T18:21:04Z")

</div>

Hey there @gestaoconfiguracoes welcome to the community!

Can you share a bit more about your approach and which Auth0 SDK(s) you might be using? Are you working with both ID and access tokens currently? What do those tokens look like?

Let us know!

---

<div class="post-metadata">

**Author:** ![gestaoconfiguracoes](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gestaoconfiguracoes/32/45730_2.png) [@gestaoconfiguracoes](https://community.auth0.com/u/gestaoconfiguracoes)\
**Post date:** [June 26, 2023, 6:56pm UTC](https://community.auth0.com/t/get-user-metadata/109973/4 "2023-06-26T18:56:20Z")

</div>

Thanks for the feedback.  
My idea is to create each of my clients (companies) as an “Organization” in Auth0 and register all my products. Next, I will register the internal users of these companies, freeing them to access the products that that company has access to. For this, I intend to use the auth0 authentication token to find out who the user is logging in and what tools he has access to direct him to the correct url already authenticated.  
The token needs to have some specific metadata: email, roles, profile, etc. Because some features of the tool use this information.  
Is this a correct approach?

---

<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:** [July 21, 2023, 9:35pm UTC](https://community.auth0.com/t/get-user-metadata/109973/5 "2023-07-21T21:35:51Z")

</div>

Hey there @gestaoconfiguracoes sorry for the delayed response, but wanted to get back to this one for future reference.

> [@gestaoconfiguracoes](#):
>
> The token needs to have some specific metadata: email, roles, profile, etc. Because some features of the tool use this information.  
> Is this a correct approach?

This does sound like the correct approach - You will most likely want to look into using a combination of [RBAC](https://auth0.com/docs/manage-users/access-control/rbac), [Organizations](https://auth0.com/docs/manage-users/organizations), and app/user [metadata](https://auth0.com/docs/manage-users/user-accounts/metadata).

The following docs may be useful as well:

> **[Business to Business](https://auth0.com/docs/get-started/architecture-scenarios/business-to-business)**
>
> Explains the architecture scenario B2B IAM with a SAAS application.

Hope this helps!

---

<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:** [August 4, 2023, 9:36pm UTC](https://community.auth0.com/t/get-user-metadata/109973/6 "2023-08-04T21:36:16Z")

</div>

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