# Auth0/react sign out multiple applications

**URL:** <https://community.auth0.com/t/auth0-react-sign-out-multiple-applications/107219>\
**Category:** Get Help\
**Tags:** application, sso\
**Created:** [May 17, 2023, 8:28pm UTC](https://community.auth0.com/t/auth0-react-sign-out-multiple-applications/107219 "2023-05-17T20:28:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![DawnMD](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawnmd/32/47318_2.png) [@DawnMD](https://community.auth0.com/u/DawnMD)\
**Post date:** [May 17, 2023, 8:28pm UTC](https://community.auth0.com/t/auth0-react-sign-out-multiple-applications/107219/1 "2023-05-17T20:28:33Z")

</div>

In my tenant there are two SPA applications connected with no social logins. Signing in at one application signs me up at another. But I’ve to logout from those separately. Is there any way to logout from all the applications at once?

---

<div class="post-metadata">

**Author:** ![SaqibHussain](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/saqibhussain/32/42924_2.png) [@SaqibHussain](https://community.auth0.com/u/SaqibHussain)\
**Post date:** [May 17, 2023, 8:45pm UTC](https://community.auth0.com/t/auth0-react-sign-out-multiple-applications/107219/3 "2023-05-17T20:45:13Z")

</div>

Hi @DawnMD

Welcome to the Auth0 Community.

We discuss your options in logging out of multiple applications here, in brief you can either configure short timeouts in your local session and redirect to Auth0 regularly to re-authenticate or handle at application level and let other applications know a log out has occurred in which case they should also logout, please see [https://auth0.com/docs/authenticate/login/logout/log-users-out-of-applications](https://auth0.com/docs/authenticate/login/logout/log-users-out-of-applications)

Warm regards.

---

<div class="post-metadata">

**Author:** ![DawnMD](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawnmd/32/47318_2.png) [@DawnMD](https://community.auth0.com/u/DawnMD)\
**Post date:** [May 18, 2023, 4:06am UTC](https://community.auth0.com/t/auth0-react-sign-out-multiple-applications/107219/4 "2023-05-18T04:06:30Z")

</div>

Following the second option i.e letting the other application know from within application itself, should I just call /logout ending with different clientID during logout?

---

<div class="post-metadata">

**Author:** ![SaqibHussain](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/saqibhussain/32/42924_2.png) [@SaqibHussain](https://community.auth0.com/u/SaqibHussain)\
**Post date:** [May 18, 2023, 12:32pm UTC](https://community.auth0.com/t/auth0-react-sign-out-multiple-applications/107219/5 "2023-05-18T12:32:42Z")

</div>

Hi @DawnMD

Yes call logout from the respective applications using the correct client\_id for that application as Auth0 will use the client\_id to get the authorised redirect\_uri’s to ensure the redirect\_uri passed into logout is authorised.

Warm regards.

---

<div class="post-metadata">

**Author:** ![DawnMD](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawnmd/32/47318_2.png) [@DawnMD](https://community.auth0.com/u/DawnMD)\
**Post date:** [May 18, 2023, 6:13pm UTC](https://community.auth0.com/t/auth0-react-sign-out-multiple-applications/107219/6 "2023-05-18T18:13:26Z")

</div>

Hi @SaqibHussain

What I was trying for example I’m in application B and I call logout from `useAuth0` two times with client ID of app A and client ID of app B. But then when I visit application A its still in logged in state, no results after a hard refresh. Anything I’m understanding wrong here?

Thanks you

---

<div class="post-metadata">

**Author:** ![SaqibHussain](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/saqibhussain/32/42924_2.png) [@SaqibHussain](https://community.auth0.com/u/SaqibHussain)\
**Post date:** [May 20, 2023, 11:50pm UTC](https://community.auth0.com/t/auth0-react-sign-out-multiple-applications/107219/7 "2023-05-20T23:50:00Z")

</div>

Hi @DawnMD

It doesn’t quite work that way, you would need to call logout from application a with the client\_id for application a and then call logout from application b with the client\_id of application b.

Therefore you would need a way to inform application b that a logout has been performed on application a so it too needs to perform a logout.

One way you may implement this is possibly having your own session management API, a user logout on one app sets a flag there (posting the user\_id, email, connection, client\_id etc). You have key pages in your applications that poll your session management API and if a record exists for the user and connection, this indicates a logout has occurred (check if the logout is recent using a configurable threshold maybe) then within that application redirect the user to our [logout endpoint](https://auth0.com/docs/api/authentication#logout) and perform any [application level session](https://auth0.com/docs/authenticate/login/logout) clear up if relevant.

I hope this helps.

Warm regards.

---

<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 3, 2023, 11:50pm UTC](https://community.auth0.com/t/auth0-react-sign-out-multiple-applications/107219/8 "2023-06-03T23:50:36Z")

</div>

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