SSO, old disabled accounts

The server hosting our Discourse instance crashed and burned, and we have a only a pretty old Discourse backup.
The instance, which we restored, uses SSO with Drupal.

Question: between the time of the last backup and now, several users were deactivated in Drupal, so will correctly not be able to reconnect to Discourse (I assume).
But what about email notifications? We have already been told that some ex-users received some notifications. Is there a way to automatically make Discourse understand which users should not receive them anymore? I’d really like not to manually go through the list of users :slight_smile:

You could have Drupal use the API to deactivate those users. Or generate a list and deactivate them from the rails console.

Sounds good. Any pointers on how to do that?

To find the API calls you can see How to reverse engineer the Discourse API. Also, the topics on SSO should provide some info on how to have SSO master disable accounts. For you, though, the accounts are already disabled, so you’ll probably want to get a list of them . . . somehow . . . and then something like

 Users.where(somehow get the users).update_all(active: false)

(That’s not exactly right, but that’s the idea.)

If it’s an emergency and you have a budget, my contact info is in my profile.

Thank you, but I was asking mostly if there is a standard SSO thingy/process/endpoint/call to handle these kind of things (sync active users).

Apparently not :slight_smile:

Will try and cook my own.

1 Like

There is. You can probably find it in the wp-discourse plugin, but the easiest way to find it is to deactivate an account with the developer tools open and see what call it makes.