Log out all users via API

I’ve built a Discourse integration for our product that allows SSO with our product to a Discourse install. When a user is signed out on our app, I’m doing an API-backed POST via the log_out API. Is there a way to log all users out or change settings remotely? If our user disconnects the Discourse integration, I’d love to nullify their custom SSO settings and sign out all users without having to do 100s of POST requests.

You would need a plugin here with a custom http endpoint

2 Likes

Noted.

Is there a log out all users in the admin interface so I could document how to do this for customers who can’t install a plugin?

To log out every user on the system you would nuke all rows from the user auth tokens table

4 Likes

I’ve documented Rails code that (in addition to doing other things) logs out all users and sends them the usual notification that there were logged out here, in case this helps you:

7 Likes

This is great, thanks, Felix.