# Revoke refresh tokens after password change

**URL:** <https://community.auth0.com/t/revoke-refresh-tokens-after-password-change/68172>\
**Category:** Get Help\
**Created:** [August 18, 2021, 8:41pm UTC](https://community.auth0.com/t/revoke-refresh-tokens-after-password-change/68172 "2021-08-18T20:41:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chriscosentino](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/chriscosentino/32/12821_2.png) [@chriscosentino](https://community.auth0.com/u/chriscosentino)\
**Post date:** [August 18, 2021, 8:41pm UTC](https://community.auth0.com/t/revoke-refresh-tokens-after-password-change/68172/1 "2021-08-18T20:41:51Z")

</div>

When an account resets password I need all logged in sessions of that account to logout. I set the refresh token to update every 5 minutes. I made a trigger action based on this example from the docs: [Post Change Password Flow](https://auth0.com/docs/actions/triggers/post-change-password). In the first example is what I am looking for. The only thing is they call their own api, not the auth0 api. The auth0 revoke refresh token api requires the refresh token id which I dont have access to in that scope. Any other solutions?

---

<div class="post-metadata">

**Author:** ![sgo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sgo/32/13789_2.png) [@sgo](https://community.auth0.com/u/sgo)\
**Post date:** [August 24, 2021, 4:29pm UTC](https://community.auth0.com/t/revoke-refresh-tokens-after-password-change/68172/2 "2021-08-24T16:29:01Z")

</div>

Hi @chriscosentino,

Are you using rotating refresh tokens? If so, automatic re-use detection could do this for you, as only the latest Refresh Token would be accepted, if any Refresh Token in the ‘family’ was reused, all Refresh Tokens would be invalidated and require the user to re-authenticate to get a new Refresh Token.  
So after a password reset, it would only take the legitimate user a single attempt to get a new Refresh Token to invalidate all other refresh tokens and ensure only the user with the latest password could get a new one.

- [Refresh Token Rotation](https://auth0.com/docs/tokens/refresh-tokens/refresh-token-rotation)

If you still wanted to go down the route of revoking refresh tokens straight away, you would need to call the GET Device-credentials endpoint in your action to fetch the user\_id’s refresh tokens, and then subsequently revoke it:

- [Revoke Refresh Tokens](https://auth0.com/docs/tokens/refresh-tokens/revoke-refresh-tokens#use-the-management-api)

There is a guide here on how to use the Management API within Actions:

- [How can I use the Management API in Actions?](https://community.auth0.com/t/how-can-i-use-the-management-api-in-actions/64947)

---

<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:** [August 26, 2021, 9:21am UTC](https://community.auth0.com/t/revoke-refresh-tokens-after-password-change/68172/3 "2021-08-26T09:21:55Z")

</div>

Thanks for helping on this one Steve!

---

<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:** [September 10, 2021, 9:22am UTC](https://community.auth0.com/t/revoke-refresh-tokens-after-password-change/68172/4 "2021-09-10T09:22:26Z")

</div>

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