# Como obter o user\_id para fazer uma chamada de logout na API

**URL:** <https://meta.discourse.org/t/how-to-obtain-the-user-id-so-i-can-issue-a-logout-api-call/102033>\
**Category:** SSO\
**Created:** [Novembro 14, 2018, 2:55pm UTC](https://meta.discourse.org/t/how-to-obtain-the-user-id-so-i-can-issue-a-logout-api-call/102033 "2018-11-14T14:55:32Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![TeoWneD](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@TeoWneD](https://meta.discourse.org/u/TeoWneD)\
**Post date:** [Novembro 14, 2018, 2:55pm UTC](https://meta.discourse.org/t/how-to-obtain-the-user-id-so-i-can-issue-a-logout-api-call/102033/1 "2018-11-14T14:55:33Z")

</div>

I searched into many differents posts about SSO logout. But i didn’t found my answer.  
We want to setup the SSO LOGOUT.  
You also have to know that we implemented SSO.

What is the query, that can return the UID, when i input username.

With that query we will be able to logout a user on the forum that just logout from the main website

This is the closest answer i found.

> [@DeanMarkTaylor](#):
>
> I believe you can make a server-side API call to:  
> ~~`http://discourse.example.com/admin/users/example_username/log_out`~~  
> `http://discourse.example.com/admin/users/{user_id}/log_out`   
> Where the `user_id` is a number.
> 
> This will logout all active discourse user sessions for `example_username` - obviously double check this works as expected for you.
> 
> The same as other Discourse API calls pass the “API Key” as needed:  
> `http://discourse.example.com/admin/api`

Can’t we just use sso,sig and token to identify ourself to the forum ? i mean by that that the main website already has those information, is there any way to use it to identify the user we want to logout

---

_[View the full topic](https://meta.discourse.org/t/how-to-obtain-the-user-id-so-i-can-issue-a-logout-api-call/102033)._
