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
This commit is contained in:
Antoine Nguyen
2019-06-13 12:13:26 +02:00
parent da24e2c877
commit f80eff16db
+2
View File
@@ -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", {