浏览代码

Explicitly set authentication mode in ldap3

This only makes a difference for versions of ldap3 before 1.0, but a)
its best to be explicit and b) there are distributions that package
ancient versions for ldap3 (e.g. debian).
Erik Johnston 7 年之前
父节点
当前提交
27d3f2e7ab
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      synapse/util/ldap_auth_provider.py

+ 2 - 1
synapse/util/ldap_auth_provider.py

@@ -236,7 +236,8 @@ class LdapAuthProvider(object):
                 value=localpart,
                 base=self.ldap_base
             )
-            conn = ldap3.Connection(server, bind_dn, password)
+            conn = ldap3.Connection(server, bind_dn, password,
+                                    authentication=ldap3.AUTH_SIMPLE)
             logger.debug(
                 "Established LDAP connection in simple bind mode: %s",
                 conn