# Limit the number of active users on Application

**URL:** <https://community.auth0.com/t/limit-the-number-of-active-users-on-application/135368>\
**Category:** Get Help\
**Tags:** other, missing-category\
**Created:** [May 31, 2024, 9:21am UTC](https://community.auth0.com/t/limit-the-number-of-active-users-on-application/135368 "2024-05-31T09:21:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AnthonyDaSilva](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/anthonydasilva/32/33385_2.png) [@AnthonyDaSilva](https://community.auth0.com/u/AnthonyDaSilva)\
**Post date:** [May 31, 2024, 9:21am UTC](https://community.auth0.com/t/limit-the-number-of-active-users-on-application/135368/1 "2024-05-31T09:21:12Z")

</div>

I’m trying to found a way to restrict the number of active users on an application.  
Is it something doable through actions ?

Like when a user login, get all active tokens on the application and if it’s above the limit, revoke the oldest token…

I’m open to suggestions ^^

---

<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 7, 2024, 11:02pm UTC](https://community.auth0.com/t/limit-the-number-of-active-users-on-application/135368/3 "2024-06-07T23:02:15Z")

</div>

Hey @AnthonyDaSilva !

> [@AnthonyDaSilva](#):
>
> Like when a user login, get all active tokens on the application and if it’s above the limit, revoke the oldest token…

Hmm good question - I can’t think a good way to go about this unfortunately. You’d most likely want to focus on a user’s session rather than tokens, but other than [logout](https://auth0.com/docs/authenticate/login/logout) endpoints there isn’t a great way to do this. It would also be difficult to determine/decide on the “oldest” session and could make for a poor UX 😕 While not exactly the use case described, you could effectively deny user’s in Action based on the number of users already associated with a `client_id` - This approach is not straightforward either and would take a bit of legwork.

---

<div class="post-metadata">

**Author:** ![AnthonyDaSilva](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/anthonydasilva/32/33385_2.png) [@AnthonyDaSilva](https://community.auth0.com/u/AnthonyDaSilva)\
**Post date:** [June 10, 2024, 6:38am UTC](https://community.auth0.com/t/limit-the-number-of-active-users-on-application/135368/4 "2024-06-10T06:38:28Z")

</div>

Hey @ty.frith

Thank you for your response.  
I understand it’s a tricky thing to do. I’ll experiment and try some things.

---

<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 10, 2024, 3:21pm UTC](https://community.auth0.com/t/limit-the-number-of-active-users-on-application/135368/5 "2024-06-10T15:21:50Z")

</div>

Happy to help where I can 🙂 Keep us posted!

---

<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:** [June 24, 2024, 3:22pm UTC](https://community.auth0.com/t/limit-the-number-of-active-users-on-application/135368/6 "2024-06-24T15:22:44Z")

</div>

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