# Limit application access to a particular role

**URL:** <https://community.auth0.com/t/limit-application-access-to-a-particular-role/57938>\
**Category:** Get Help\
**Tags:** web, authorization, login, auth0\
**Created:** [February 16, 2021, 1:01pm UTC](https://community.auth0.com/t/limit-application-access-to-a-particular-role/57938 "2021-02-16T13:01:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![almad\_httpie](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/almad_httpie/32/26690_2.png) [@almad\_httpie](https://community.auth0.com/u/almad_httpie)\
**Post date:** [February 16, 2021, 1:01pm UTC](https://community.auth0.com/t/limit-application-access-to-a-particular-role/57938/1 "2021-02-16T13:01:31Z")

</div>

I have an admin web application (regular web application) and I only want users with the “admin” role to log in. How can I do that?

It seems to me I can do that by using a rule based on “Active Directory group membership”, but it seems to me like it should be simpler and I am missing something obvious.

Thanks for the hints!

---

<div class="post-metadata">

**Author:** ![cibrax](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/cibrax/32/27644_2.png) [@cibrax](https://community.auth0.com/u/cibrax)\
**Post date:** [February 16, 2021, 8:35pm UTC](https://community.auth0.com/t/limit-application-access-to-a-particular-role/57938/2 "2021-02-16T20:35:32Z")

</div>

One way is to inject roles in the ID or Access Token, and check for that in your api. [Auth0 - Enrich ID tokens with custom data](https://thecibrax.com/auth0-enrich-id-tokens-with-custom-data)

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [February 17, 2021, 5:17pm UTC](https://community.auth0.com/t/limit-application-access-to-a-particular-role/57938/3 "2021-02-17T17:17:54Z")

</div>

Thanks for sharing that with the rest of community!

---

<div class="post-metadata">

**Author:** ![almad\_httpie](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/almad_httpie/32/26690_2.png) [@almad\_httpie](https://community.auth0.com/u/almad_httpie)\
**Post date:** [February 17, 2021, 5:33pm UTC](https://community.auth0.com/t/limit-application-access-to-a-particular-role/57938/4 "2021-02-17T17:33:22Z")

</div>

@cibrax if I understand it correctly, that means users would be successfully authenticated in the Auth0, but denied access on the API/application side?

I’ll try that, but I’d really love it I could deny authorization on the Auth0 side already as I consider this particular API less secure.

---

<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:** [March 4, 2021, 5:34pm UTC](https://community.auth0.com/t/limit-application-access-to-a-particular-role/57938/5 "2021-03-04T17:34:10Z")

</div>

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