# How to incorporate roles in the useUser hook from nextjs-auth0?

**URL:** <https://community.auth0.com/t/how-to-incorporate-roles-in-the-useuser-hook-from-nextjs-auth0/92361>\
**Category:** Get Help\
**Tags:** rbac, nextjs\
**Created:** [October 13, 2022, 5:32pm UTC](https://community.auth0.com/t/how-to-incorporate-roles-in-the-useuser-hook-from-nextjs-auth0/92361 "2022-10-13T17:32:14Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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:** [October 14, 2022, 1:01am UTC](https://community.auth0.com/t/how-to-incorporate-roles-in-the-useuser-hook-from-nextjs-auth0/92361/3 "2022-10-14T01:01:44Z")

</div>

Hey there @faabiopk welcome to the community!

Most of what you’ve described seems correct so that’s good 🙂 I don’t think the namespace you’ve used (`auth0.com`) will work per the guidelines [here](https://auth0.com/docs/secure/tokens/json-web-tokens/create-custom-claims#namespaced-guidelines). Are you able to test using a different namespace or a non-namespaced value instead?

I also recommend checking out this post with regards to permissions:

> [@Retrieve user roles and permission on profile with nextjs](https://community.auth0.com/t/retrieve-user-roles-and-permission-on-profile-with-nextjs/92070/3):
>
> hey @barekliton welcome to the community! You’ll need to explicitly add the roles to ID Tokens using an Action as outlined in the following FAQ: [https://community.auth0.com/t/how-to-add-roles-and-permissions-to-the-id-token-using-actions/84506](https://community.auth0.com/t/how-to-add-roles-and-permissions-to-the-id-token-using-actions/84506) Permissions are a bit different, and are typically kept within the context of an access token. I recommend taking a look at [RBAC](https://auth0.com/docs/manage-users/access-control/rbac) as this provides you with the option (assuming you have an API registered in Auth0) to automatically add permissions to user…

Hope this helps!

---

_[View the full topic](https://community.auth0.com/t/how-to-incorporate-roles-in-the-useuser-hook-from-nextjs-auth0/92361)._
