# Doubts about how to obtain user roles in a SPA

**URL:** <https://community.auth0.com/t/doubts-about-how-to-obtain-user-roles-in-a-spa/75053>\
**Category:** Get Help\
**Tags:** react, roles, auth0\
**Created:** [December 16, 2021, 2:58pm UTC](https://community.auth0.com/t/doubts-about-how-to-obtain-user-roles-in-a-spa/75053 "2021-12-16T14:58:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Limpi23](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/limpi23/32/33842_2.png) [@Limpi23](https://community.auth0.com/u/Limpi23)\
**Post date:** [December 16, 2021, 2:58pm UTC](https://community.auth0.com/t/doubts-about-how-to-obtain-user-roles-in-a-spa/75053/1 "2021-12-16T14:58:46Z")

</div>

Greetings community, I have many doubts about how to work the Role-Based Access Control approach in SPA applications, I have the following scenario: implement authentication to my SPA as is the quick start of oauth2, investigate that for roles I must use this extension “Auth0 Authorization” but my question is how by adding roles and permissions I can read this in my SPA to save that user state.

Thanks for the help

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [December 16, 2021, 7:44pm UTC](https://community.auth0.com/t/doubts-about-how-to-obtain-user-roles-in-a-spa/75053/3 "2021-12-16T19:44:21Z")

</div>

Hi @Limpi23,

Welcome to the Auth0 Community!

I understand you have some questions regarding _Role-Base Access Control (RBAC)_. I’d be happy to help.

First, I’d like to inform you that the Auth0 Authorization Extension will eventually be deprecated. Given that, I strongly recommend you use the Authorization Core to implement RBAC.

Using the Authorization Core will improve scalability and performance.

To do so, please take a look at our [Authorization Core](https://auth0.com/docs/authorization/rbac/auth-core-features) documentation.

Then in the authentication flow, you can pass the user’s permission in the `scope` parameter to allow them to gain access to a specific resource.

And optionally, you can get the permissions and roles from your users using the [get user permissions endpoint](https://auth0.com/docs/api/management/v2#!/Users/get_permissions) and [get user roles endpoint](https://auth0.com/docs/api/management/v2#!/Users/get_user_roles) respectively.

Please let me know if you have any questions or need further clarification. I’d be happy to help.

Thank you.

---

<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:** [December 31, 2021, 7:44pm UTC](https://community.auth0.com/t/doubts-about-how-to-obtain-user-roles-in-a-spa/75053/4 "2021-12-31T19:44:33Z")

</div>

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