Syncing bans from SSO provider

Would it be possible to sync a ban/suspension via SSO? If this is too broad for SSO (which, tbh, it probably is) is there a different API that would make it fairly simple?

For Hummingbird.me, we often get people we have to suspend (and occasionally hellban) to protect our other users, but we have to currently do two separate bans: one for our own server and one for Discourse, which frequently results in desynchronized bans… And the occasional “oh shit I’m sorry dude I thought we unbanned you months ago!”, which is about as awkward as it gets.

Anyways, I’m in the process of switching us to SSO from our current hand-rolled (yuck!) system, and I noticed that there’s already support for admin and moderator syncing (huzzah!) and custom fields (awesome!) and avatars (yay!) but it doesn’t look like there’s any way to synchronize the bans from our service onto Discourse.

So I guess my questions are:

  1. Is this possible in SSO or via the API?
  2. Assuming the answer is is “no”, how hard would it be to add? Where should I look to start?
1 Like

Hey this is great news, are you updating hummingbird.me to latest Discourse? Definitely switch to standard SSO, we’ll be happy to assist as we can.

1 Like

Yeah, we’re planning to completely rebuild our Discourse integrations from scratch as well as switch to a new box. We’ve been meaning to upgrade Discourse for a long time, but because our mods are kinda awkwardly tied into lots of Discourse internals (theres even an added database column without migrations, yuck), it requires a lot of staging before a production deploy, and we just haven’t had the time.

SSO reduces the amount of code we have inside Discourse, removes the need for our highly-regrettable discourse fork, and obsoletes most of our discourse plugin, so it hopefully it means we don’t have to so carefully stage our deploys and can keep up with future updates on a more reasonable schedule.

I’ll probably have plenty of questions when I get down to doing deeper integrations (badges, notifications, etc.) — right now it’s fairly smooth sailing since we’re just in SSO territory

5 Likes

I think that a pair of values, suspended_until and suspended_reason would work. Does that work for you @Nuck?

And no, it’s not supported yet. These are the supported fields: https://github.com/discourse/discourse/blob/master/lib/single_sign_on.rb#L2-L3

2 Likes

Hi! Has there been any update on this? I’m interested as well.

1 Like