Merge pull request #1792 from petervarkoly/fix-ldap-bind
Fix binding ldap server.
This commit is contained in:
@@ -226,7 +226,7 @@ class Auth(auth.BaseAuth):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.debug(f"_login3 error 1 {e} (reader)")
|
logger.debug(f"_login3 error 1 {e} (reader)")
|
||||||
pass
|
pass
|
||||||
if not conn.bind():
|
if not conn.bind(read_server_info=False):
|
||||||
logger.debug("_login3 cannot bind (reader)")
|
logger.debug("_login3 cannot bind (reader)")
|
||||||
raise RuntimeError("Unable to read from LDAP server")
|
raise RuntimeError("Unable to read from LDAP server")
|
||||||
logger.debug(f"_login3 bind as {self._ldap_reader_dn}")
|
logger.debug(f"_login3 bind as {self._ldap_reader_dn}")
|
||||||
@@ -257,7 +257,7 @@ class Auth(auth.BaseAuth):
|
|||||||
conn.start_tls()
|
conn.start_tls()
|
||||||
except self.ldap3.core.exceptions.LDAPStartTLSError as e:
|
except self.ldap3.core.exceptions.LDAPStartTLSError as e:
|
||||||
raise RuntimeError(f"_login3 StartTLS Error: {e}")
|
raise RuntimeError(f"_login3 StartTLS Error: {e}")
|
||||||
if not conn.bind():
|
if not conn.bind(read_server_info=False):
|
||||||
logger.debug(f"_login3 user '{login}' cannot be found")
|
logger.debug(f"_login3 user '{login}' cannot be found")
|
||||||
return ""
|
return ""
|
||||||
tmp: list[str] = []
|
tmp: list[str] = []
|
||||||
|
|||||||
Reference in New Issue
Block a user