【发布时间】:2023-03-10 06:11:02
【问题描述】:
我正在使用在线 LDAP 测试服务器(https://www.forumsys.com/tutorials/integration-how-to/ldap/online-ldap-test-server/)
我正在尝试使用 python ldap3 模块连接到它。
这是我的代码:
import ldap3
user = 'riemann'
password = 'password'
server = ldap3.Server('ldap.forumsys.com', port=389)
connection = ldap3.Connection(server, user=user, password=password)
connection.bind()
conn = connection.search(search_base='ou=mathematicians,dc=example,dc=com', search_filter='(&(objectClass=user)(userPrincipalName='+user+'))', attributes='*')
print conn
当我检查 conn 时,它是 False。
有人可以帮我建立连接吗 提前致谢
【问题讨论】:
-
以下是30 code examples,用于展示如何使用
ldap3和Tutorial: Introduction to ldap3。
标签: python ldap openldap python-ldap ldap3