# Revoke all Auth0 sessions except the current one for some users

**URL:** <https://community.auth0.com/t/revoke-all-auth0-sessions-except-the-current-one-for-some-users/110589>\
**Category:** Get Help\
**Tags:** sessions, logout\
**Created:** [July 5, 2023, 10:33am UTC](https://community.auth0.com/t/revoke-all-auth0-sessions-except-the-current-one-for-some-users/110589 "2023-07-05T10:33:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![filip.vuletic](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/filip.vuletic/32/46711_2.png) [@filip.vuletic](https://community.auth0.com/u/filip.vuletic)\
**Post date:** [July 5, 2023, 10:33am UTC](https://community.auth0.com/t/revoke-all-auth0-sessions-except-the-current-one-for-some-users/110589/1 "2023-07-05T10:33:01Z")

</div>

I have been reading for days, and tried to use help of AIs but to no avail.

So my requirement is like this: For some users, I want to revoke all loggings except current one. Lets say user changes password, I want to invalidate all sessions except current one.

My current workflow goes like this. It is legacy app so I am not original maker.  
User goes to my page, my app checks ASP .NET session and if it has expired it redirects user to Auth0, if user has never been logged in it prompts Username and Password, if user has been logged in it just forwards to my page where I get AccessToken to get some details I need (nickname), and that is it I generate new [ASP.NET](http://ASP.NET) Session.

So now I want to invalidate all Auth0 sessions, except last one, so user has to Login again, but only in some use cases, so not all cases. If I invalidate [ASP.Net](http://ASP.Net) session it just gets new one as Auth0 one is still valid. I cannot redirect that user on other devices that he is logged in to invalidate SSO cookie.

I do not use any identity provider except username and password.  
Devices tab for each user is empty - so device\_credentials approach is not valid  
ChatGPT4 suggests /users/userid/sessions endpoint, but it seems he is hallucinating that endpoint.

I do get something using api/v2/grants, but there is no info what is the current and what are others and I do not think that would be right approach.

Is there any way to handle this that I am missing out?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [July 7, 2023, 1:31pm UTC](https://community.auth0.com/t/revoke-all-auth0-sessions-except-the-current-one-for-some-users/110589/3 "2023-07-07T13:31:41Z")

</div>

Hi @filip.vuletic,

We don’t currently support an out of the box solution for this type of session management (probably why the AI answers are not getting anywhere).

In the case of password changes, the sessions should be revoked automatically. Can you take a look at this thread and see if you are seeing similar behavior?

> [@SPA invalidate all sessions on password change](https://community.auth0.com/t/spa-invalidate-all-sessions-on-password-change/52902/6):
>
> Hi @dan.woda, Apologies for late reply. Was stuck in one of the feature completion. Thanks for your guidance. We didn’t use IDP or Application session so there was no question of those 2 sessions. I checked that in settings, ID token expiration time was 3600 seconds and so changed it to shorter lifetime and everything seems to work fine now. However, I have 2 questions to completely clarify the matter: Case 1: I changed ID expiration time to 1 second for testing purpose. I logged in with c…

---

<div class="post-metadata">

**Author:** ![filip.vuletic](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/filip.vuletic/32/46711_2.png) [@filip.vuletic](https://community.auth0.com/u/filip.vuletic)\
**Post date:** [July 10, 2023, 10:09am UTC](https://community.auth0.com/t/revoke-all-auth0-sessions-except-the-current-one-for-some-users/110589/4 "2023-07-10T10:09:47Z")

</div>

Unfortunately my use case is not just reset password I made that example as it is simplest to explain.

I have also tiers, and one of the tiers is One Login per One User. I do not care about application session as it has short lifespan so it will end rather soon I just want for user to be prompted to login, and on login logout all other machines. Not for all cases, just for some users.

I can handle that as additional session management from my application but that brings unnecessary complications, but if that is the only option…

So you can confirm there is no Authentication API or Management API endpoint or Rule/Action that will invalidate all Auth0 sessions except the one currently used for single user?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [July 10, 2023, 2:04pm UTC](https://community.auth0.com/t/revoke-all-auth0-sessions-except-the-current-one-for-some-users/110589/5 "2023-07-10T14:04:47Z")

</div>

> [@filip.vuletic](#):
>
> So you can confirm there is no Authentication API or Management API endpoint or Rule/Action that will invalidate all Auth0 sessions except the one currently used for single user?

I can confirm that is the case.

---

<div class="post-metadata">

**Author:** ![filip.vuletic](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/filip.vuletic/32/46711_2.png) [@filip.vuletic](https://community.auth0.com/u/filip.vuletic)\
**Post date:** [July 10, 2023, 3:13pm UTC](https://community.auth0.com/t/revoke-all-auth0-sessions-except-the-current-one-for-some-users/110589/6 "2023-07-10T15:13:05Z")

</div>

Ok then, that is fine as if we used refresh token as it was supposed to be used, we would have required functionality with revoke refresh token 🙂

Thank you very much on your help once again Dan!

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [July 10, 2023, 3:27pm UTC](https://community.auth0.com/t/revoke-all-auth0-sessions-except-the-current-one-for-some-users/110589/7 "2023-07-10T15:27:02Z")

</div>

No problem! Please let us know if you have any other questions.

---

<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 24, 2023, 3:27pm UTC](https://community.auth0.com/t/revoke-all-auth0-sessions-except-the-current-one-for-some-users/110589/8 "2023-07-24T15:27:39Z")

</div>

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