Managing group membership via authentication

I agree.

hm yes, however there are cases in which supporting a boolean claim makes sense. But yes, I agree let’s keep it simple for now by just supporting a string array.

Doing it authenticator by authenticator, I guess we’d also have a group_sync_enabled? method in the Auth::Authenticator which would be overriden in individual authenticators, and in the generic authenticators upon the existence of a value in the relevant setting.

That actually raises an interesting question. This could also be used by the specific service authenticators, such as facebook (“groups”?), google (“groups”?) and discord (“roles”?). Not sure whether their id tokens would contain such info, but perhaps worth considering from a technical design perspective (i.e. the ability to add this down the track). Not a primary concern for v1 though I don’t think.

Those mechanics sound fine, however I’m curious why we’ve switched to using “roles” instead of “groups” here. Not a huge issue, but want to be sure there’s not something I’m missing.

From a UX perspective I can see confusion arising out of that use of nomeclature (i.e. “roles” and “groups” at the same time), even if it’s grounded in a useful technical distinction. Also possible developer confusion if coming to this without this background context.

I like the seperate table, however perhaps we should have a foreign key association with user_associated_accounts instead of provider_name? It could be useful in things like cleanup operations. I guess the answer to that question is partly how much we want the group/role association to be interlinked with the associated account from a product perspective. Would there be any downside to linking the two now?

** Edit, I guess we already have the association via the user_id.

That sounds fine, however I’m just thinking that we also have this information on a provider basis by virtue of the site setting you proposed, which would also cover the case of when the role hasn’t been seen. Perhaps there’s a way to use Discourse.authenticators here, i.e. an in-memory list of providers’ and their claims?

I think that’s a good compromise. Particularly if we also have the site setting mentioned below.

On a plugin (i.e. authenticator) basis? If so, I’m on board. That should service that need for v1.

Good summary of the user flow :+1: Pending the relatively minor suggestions I’ve made, I’m on board with the direction.