Log out all users via API

(Benjamin Borowski) #1

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.

(Sam Saffron) #2

You would need a plugin here with a custom http endpoint

(Benjamin Borowski) #3


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?

(Sam Saffron) #4

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

(Felix Freiberger) #5

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:

(Benjamin Borowski) #6

This is great, thanks, Felix.