@sam What do you think about this idea? Is it something that’s likely to be added?
We just started our community and are rolling out to a number of different audiences in stages. The first audience is general and doesn’t need to be added to any groups, but our next audience will be a specific group that should get special treatment.
The only issue I see with having a remove_groups flag is that I will need to know what groups the user is no longer a member of to remove them. What about supporting three keys:
groups: [group1,group2,group3] # ensure user is only in groups1, group2, and group3
or
add_groups: [group4] # ensure user is in group4
remove_groups: [group2] # ensure user is not in group2
This way, my main app can handle all the logic and Discourse will simply be kept in sync.
I think the only way that works is the second one, because otherwise the membership of any group you create through the Discourse UI will have its members removed as they re-log.
The remove groups parameter would then be managed_group_list - user.groups (inventing the terminology of a “sso-managed group” for the sake of this post).
We can revisit that design if the managed groups list gets too big.
That’s the desired behavior for me. I don’t want people managing user groups in the discourse admin. I want our main app to have full control of group memberships.
Sorry to re-open this, but I’m trying to make sure I understand what was (or wasn’t) done to solve the use cases presented earlier.
I’m also on SSO. With a Discourse hosted site. We want to have a private forum where we can invite people select people, but unfortunately it’s not tied to a parameter we can identify and pass via SSO.
We want to upload a list of email addresses that, if/when a user signs in for the first time they are auto-added to the group. We are using the domain solution for some groups, but that wouldn’t apply in this case.
It looks like this was discussed, but it’s unclear to me which solution was ultimately chosen. I tested with an email address that was registered in our main userbase, but hadn’t logged into our discourse site to initiate the SSO. When we logged in with that ID the account created but he’s not in the group.
This is the way I found to get SSO users pre-added to a group based on a list of e-mail addresses:
Send a private message, pasting the e-mail addresses into the recipients field (supported since August 2017) to create “staged” users. (Delete the private message within email_time_window_minutes if you don’t actually want to send anything to the users)
Add the staged users to the group, either:
One-by-one, on each user’s admin page
Use “Bulk Add To Group” on the group page, and paste in the same e-mail address list
This is really helpful for importing mailing lists onto a forum when SSO is enabled.
(Sorry for the thread necromancy – seems like the question is still open 2 years later, I couldn’t find this advice anywhere else)
It would still be nice if the normal invite users feature worked with SSO, so this could be done in one step (and so moderators could do it, currently it seems like only admins can do step 2).
@RyanK / @tobiaseigen Tenho quase certeza de que isso pode ser fechado, os convites agora devem ser super compatíveis com SSO, fizemos muitos progressos nos últimos 2 anos e devemos ser capazes de lidar com seu caso de uso nativamente.
Sim, acho que podemos encerrar. É realmente muito possível convidar pessoas que então fazem login via SSO ou qualquer método de login que o site oferece. Dependendo de como o convite é configurado, o usuário convidado pode ser adicionado a grupos e inserido em um tópico específico ao fazer login. Muito legal!
A maior parte da discussão aqui é, na verdade, sobre suporte a SSO para adicionar e remover um usuário de grupos, com o qual estou menos familiarizado e não vejo muita documentação sobre isso aqui no meta. Alguém mais familiarizado poderia escrever um FAQ sobre isso para reunir o que se sabe a respeito. Ele permite que usuários sejam adicionados ou removidos de grupos ao fazerem login via SSO, o que, na verdade, não tem nada a ver com o sistema de convites.
No entanto, existem ressalvas, então talvez não valha a pena incentivar as pessoas a implementar esse método. Os grupos do Discourse já precisam existir para que isso funcione, e requer que o usuário faça logout e login novamente para que quaisquer alterações no provedor de autenticação entrem em vigor.