Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django User Authentication against LDAP - Multiple Groups

As per the documentation in django_auth_ldap at http://pythonhosted.org/django-auth-ldap/reference.html#std:setting-AUTH_LDAP_REQUIRE_GROUP

AUTH_LDAP_REQUIRE_GROUP can be used to configure the distinguished name of a group; authentication will fail for any user that does not belong to this group.

Is it possible to set multiple groups against which the user can be authenticated? instead of just one?

like image 631
Guddu Avatar asked Jun 13 '26 11:06

Guddu


1 Answers

Consider managing your groups in your views, for that to work you will need to set your user attributes with AUTH_LDAP_USER_FLAGS_BY_GROUP or AUTH_LDAP_MIRROR_GROUPS.

Also, if you want to just keep it all in the AUTH_LDAP settings, you might try looking into having multiple LDAP configurations. The site will try to authenticate against each configuration until one succeeds or they all fail.

like image 104
jordan9001 Avatar answered Jun 15 '26 00:06

jordan9001



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!