Logout user with external_id

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.

1 Like

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

6 Likes