# Restrict user without Admin role to /admin-page

**URL:** <https://community.auth0.com/t/restrict-user-without-admin-role-to-admin-page/136721>\
**Category:** Get Help\
**Tags:** user-profile, user-management\
**Created:** [June 20, 2024, 11:11am UTC](https://community.auth0.com/t/restrict-user-without-admin-role-to-admin-page/136721 "2024-06-20T11:11:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hallv-a](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@hallv-a](https://community.auth0.com/u/hallv-a)\
**Post date:** [June 20, 2024, 11:11am UTC](https://community.auth0.com/t/restrict-user-without-admin-role-to-admin-page/136721/1 "2024-06-20T11:11:06Z")

</div>

Ready to post? 🔍 First, try searching for your answer.  
How can I restrict a all users which is not of Role Admin to the /admin page?

---

<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, 2024, 3:47pm UTC](https://community.auth0.com/t/restrict-user-without-admin-role-to-admin-page/136721/3 "2024-06-20T15:47:48Z")

</div>

Hello @hallv-a welcome to the community!

It really depends on your specific app architecture, but in general you’ll want to look into implementing [Role Based Access Control](https://auth0.com/docs/manage-users/access-control/rbac) (RBAC) - At the application level (node backend for example) Auth0 provides SDKs to aid in validating a user’s access token and checking for specific claims (in this case a user’s role):

> **[claimIncludes | express-oauth2-jwt-bearer](https://auth0.github.io/node-oauth2-jwt-bearer/functions/claimIncludes.html)**
>
> Documentation for express-oauth2-jwt-bearer

---

<div class="post-metadata">

**Author:** ![hallv-a](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@hallv-a](https://community.auth0.com/u/hallv-a)\
**Post date:** [June 21, 2024, 8:49am UTC](https://community.auth0.com/t/restrict-user-without-admin-role-to-admin-page/136721/4 "2024-06-21T08:49:13Z")

</div>

Sorry, forgot som important parts: I want to use next.js on the frontend and have some backend with a .net core C# for api. The admin page is to edit products, discounts, subscriptions and general settings. Any additional comments?

---

<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 24, 2024, 4:48pm UTC](https://community.auth0.com/t/restrict-user-without-admin-role-to-admin-page/136721/5 "2024-06-24T16:48:09Z")

</div>

In that case I recommend checking out the next.js [quickstart](https://auth0.com/docs/quickstart/webapp/nextjs/01-login) for login, RBAC still applies. For validating access tokens you’ll want to check to see if any library may suit your needs at [jwt.io](https://jwt.io/libraries). The code samples [here](https://developer.auth0.com/resources/code-samples) may prove useful as well.

---

<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 8, 2024, 4:49pm UTC](https://community.auth0.com/t/restrict-user-without-admin-role-to-admin-page/136721/6 "2024-07-08T16:49:06Z")

</div>

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