# How to log out of Rocket Chat while using iframe auth?

**URL:** <https://forums.rocket.chat/t/how-to-log-out-of-rocket-chat-while-using-iframe-auth/7048>\
**Category:** Community Support\
**Created:** [May 22, 2020, 6:11am UTC](https://forums.rocket.chat/t/how-to-log-out-of-rocket-chat-while-using-iframe-auth/7048 "2020-05-22T06:11:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Redstone3](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@Redstone3](https://forums.rocket.chat/u/Redstone3)\
**Post date:** [May 22, 2020, 6:11am UTC](https://forums.rocket.chat/t/how-to-log-out-of-rocket-chat-while-using-iframe-auth/7048/1 "2020-05-22T06:11:27Z")

</div>

Hello,

I am currently using iframe auth to log users into Rocket Chat. Once they log out of my system that allowed them to log into Rocket Chat, how can I log them out? Rocket.Chat isn’t calling the iframe auth each time it is refreshed. It also seems that each user’s token changes between calling the API to log them in and the time they log out. Maybe during:

```auto
window.parent.postMessage

```

Any ideas on how to get the right token and user ID to log a user out through the API or kill the Rocket Chat session?

Thanks!

---

<div class="post-metadata">

**Author:** ![scrat](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@scrat](https://forums.rocket.chat/u/scrat)\
**Post date:** [August 30, 2022, 10:55am UTC](https://forums.rocket.chat/t/how-to-log-out-of-rocket-chat-while-using-iframe-auth/7048/2 "2022-08-30T10:55:15Z")

</div>

Hi @Redstone3 ! Did you find a solution?

Thanks,  
Regards.
