# Logout POST Request

**URL:** <https://meta.discourse.org/t/logout-post-request/192601>\
**Category:** SSO\
**Created:** [June 3, 2021, 8:39pm UTC](https://meta.discourse.org/t/logout-post-request/192601 "2021-06-03T20:39:53Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Bio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bio/32/198067_2.png) [@Bio](https://meta.discourse.org/u/Bio)\
**Post date:** [June 3, 2021, 8:39pm UTC](https://meta.discourse.org/t/logout-post-request/192601/1 "2021-06-03T20:39:53Z")

</div>

Hi, I’ve recently been trying to create a single sign out system where I can log off on my website and it will automatically log the user off of their Discourse account as well. According to this website [https://meta.discourse.org/t/discourseconnect-official-single-sign-on-for-discourse-sso/13045](https://meta.discourse.org/t/discourseconnect-official-single-sign-on-for-discourse-sso/13045)

> **Logging off users**  
> You can use the POST admin endpoint `/admin/users/{USER_ID}/log_out` to log out any user in the system if needed.  
> To configure the endpoint Discourse redirects to on logout search for the `logout redirect` setting. If no URL has been set here you will be redirected back to the URL configured in `discourse connect url` .

I’ve created an API key to accomplish this, then made a POST request using [https://reqbin.com/](https://reqbin.com/) to `https://MY_DISCOURSE_DOMAIN/admin/users/USER_ID/log_out?api_key=XXXXXXXXXXXXXXXXXXXXXX&api_username=system`  
For my API key, I allowed system to be my user. If anyone could give me some guidance as to why this isn’t working, it would be greatly appreciated.

---

_[View the full topic](https://meta.discourse.org/t/logout-post-request/192601)._
