# Logout user with external\_id

**URL:** https://meta.discourse.org/t/logout-user-with-external-id/47426
**Category:** Support
**Created:** [7월 17, 2016, 3:11오후 UTC](https://meta.discourse.org/t/logout-user-with-external-id/47426 "2016-07-17T15:11:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mz104](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@mz104](https://meta.discourse.org/u/mz104)
#### Post date: [7월 17, 2016, 3:11오후 UTC](https://meta.discourse.org/t/logout-user-with-external-id/47426/1 "2016-07-17T15:11:17Z")

</div>

I’m using SSO and I’m trying to logout a user by his external\_id, which is stored in my database.

The basic idea is that if the user logs out in the app, he logs out on the forum as well. The problem with other approaches is that they don’t use the external\_id for logging out, instead they use the normal Discourse id (which I can’t seem to change).

How can I logout a user with his external\_id?

If there’s a way to do this by redirecting the user from my app to a discourse logout url on the client, that would be preferable. But I’m also open to using the API.

---

<div class="post-metadata">

### Author: ![mz104](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@mz104](https://meta.discourse.org/u/mz104)
#### Post date: [7월 17, 2016, 3:33오후 UTC](https://meta.discourse.org/t/logout-user-with-external-id/47426/2 "2016-07-17T15:33:09Z")

</div>

Found it! We’re good, no worries. First, search the user by external id, then use the id to log them out.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [7월 18, 2016, 8:14오전 UTC](https://meta.discourse.org/t/logout-user-with-external-id/47426/3 "2016-07-18T08:14:33Z")

</div>


