discourse-ldap-auth
discourse-ldap-auth copied to clipboard
Add option to automatically add LDAP users to a group
This should add the ability to add users to groups automatically when they authenticate via LDAP.
It's a really simple patch (almost too simple...), so may need testing further than my cursory efforts.
I don't think there is a good use case for this. If you want to add a static list of groups to all users, you could do it via a script or through the admin console. I think what most people want is to add Discourse groups based on ldap user groups.
Well, it's not for all users :slightly_smiling_face:
As an example, we want to add people to a certain group (say, staff) if they log in via LDAP, rather than any of the social or email logins. An example would be where staff users have LDAP logins, but interact with the wider community on Discourse.
It seems that the only way of adding people to groups at the moment is when the plugin runs in list mode, which doesn't really help if you're trying to make ldap the single point of truth and not have to re-export the contents of the LDAP database into another file.
I could see how we could do that if the plugin fetches groups from LDAP dynamically, though in the use case above, we'd only want some LDAP groups to match against some Discourse groups. Would you welcome a patch for that, and if so, any thoughts on how to do that mapping in the interface?