# How to get RoleId from claims coming in when a user login?

**URL:** <https://community.auth0.com/t/how-to-get-roleid-from-claims-coming-in-when-a-user-login/109595>\
**Category:** Get Help\
**Tags:** user-profile, user-management\
**Created:** [June 20, 2023, 1:22pm UTC](https://community.auth0.com/t/how-to-get-roleid-from-claims-coming-in-when-a-user-login/109595 "2023-06-20T13:22:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![shivani](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@shivani](https://community.auth0.com/u/shivani)\
**Post date:** [June 20, 2023, 1:22pm UTC](https://community.auth0.com/t/how-to-get-roleid-from-claims-coming-in-when-a-user-login/109595/1 "2023-06-20T13:22:19Z")

</div>

I can see the value for the role assigned to the user not the role id

---

<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 20, 2023, 11:42pm UTC](https://community.auth0.com/t/how-to-get-roleid-from-claims-coming-in-when-a-user-login/109595/3 "2023-06-20T23:42:10Z")

</div>

Hey there @shivani welcome to the community!

> [@shivani](#):
>
> I can see the value for the role assigned to the user not the role id

Roles are only available by name - You could cross reference the Management API `/api/v2/roles` [endpoint](https://auth0.com/docs/api/management/v2#!/Roles/get_roles) but it’s important to take [rate limiting](https://auth0.com/docs/troubleshoot/customer-support/operational-policies/rate-limit-policy/management-api-endpoint-rate-limits) into account if calling this API frequently.

Hope this helps to clarify!

---

<div class="post-metadata">

**Author:** ![shivani](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@shivani](https://community.auth0.com/u/shivani)\
**Post date:** [June 21, 2023, 7:58am UTC](https://community.auth0.com/t/how-to-get-roleid-from-claims-coming-in-when-a-user-login/109595/4 "2023-06-21T07:58:18Z")

</div>

Hi @ty.frith are saying we can fetch roleid from the management api ? . Can’t we get in claims identity without making extra api call?

---

<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 21, 2023, 11:09pm UTC](https://community.auth0.com/t/how-to-get-roleid-from-claims-coming-in-when-a-user-login/109595/5 "2023-06-21T23:09:34Z")

</div>

Exactly - Unfortunately only role names are exposed in actions via the `event.authorization` object.

---

<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 5, 2023, 11:09pm UTC](https://community.auth0.com/t/how-to-get-roleid-from-claims-coming-in-when-a-user-login/109595/6 "2023-07-05T23:09:57Z")

</div>

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