From f80eff16db3a6153c9ed2c88d4f2ac5fae38dba6 Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Thu, 13 Jun 2019 12:13:26 +0200 Subject: [PATCH] ldap auth direct bind fix set AUTH_LDAP_BIND_AS_AUTHENTICATING_USER to True when direct bind auth is enabled because we need to access user attributes. See https://django-auth-ldap.readthedocs.io/en/latest/authentication.html#customizing-authentication --- modoboa/core/app_settings.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modoboa/core/app_settings.py b/modoboa/core/app_settings.py index f5967de83..f63f045da 100644 --- a/modoboa/core/app_settings.py +++ b/modoboa/core/app_settings.py @@ -500,6 +500,8 @@ class GeneralParametersForm(param_forms.AdminParametersForm): settings, "AUTH_LDAP_USER_DN_TEMPLATE", values["ldap_user_dn_template"] ) + setattr( + settings, "AUTH_LDAP_BIND_AS_AUTHENTICATING_USER", True) if values["ldap_is_active_directory"]: if not hasattr(settings, "AUTH_LDAP_GLOBAL_OPTIONS"): setattr(settings, "AUTH_LDAP_GLOBAL_OPTIONS", {