the instructions in the SSO thread to log a user


(nguyenthaonhi) #1

I’m trying to follow the instructions in the SSO thread to log a user out of Discourse from my other app.

First, I get the Discourse userId based on my app’s user id via GET /users/by-external/{MY_ID}.json . Then, I’m trying to log them out with POST /admin/users/{DISCOURSE_ID}/logout .

At first, this gave me a 403 Forbidden error. So I generated a global API key and passed that in my POST data as api_key=xxxxxx . That throws a 500 Internal Server Error. So I also tried adding api_username=xxxx to the POST data. There are several user accounts on our Discourse installation that are marked as Admin, so I’m not sure which I should use. I chose the system account. Now I get a 404 Not Found response.

I took a look through the list of endpoints as mentioned here , but don’t see anything for logout.

Help?