简体   繁体   English

Python ldap模块未引发任何异常

[英]Python ldap module not throwing any exception

I am trying to use LDAP python link to use this function. 我正在尝试使用LDAP python链接来使用此功能。 I am simply trying to implement this as a function . 我只是想将其实现为功能。 Passing parameters something like this: 传递参数是这样的:

check_credentials(username="xxxxxx",password="xxx")

But it goes into hanged state and after 5-7 mins it completes execution with no output. 但是它进入了挂起状态,并且在5到7分钟后完成了执行,没有输出。 Can someone suggets me some good article for this 有人可以为我推荐一些好文章吗

From looking at your sample code, the LDAP_USER_NAME is a not in the expected DN (distinguished name) format. 通过查看示例代码,LDAP_USER_NAME的格式不是预期的DN(专有名称)。 Typically, Active Directory users have a DN in the format of cn=<username>,cn=users,<domain>. 通常,Active Directory用户的DN格式为cn = <用户名>,cn = users,<domain>。 For example, user bjensen in the example.com domain typically would have this DN: cn=bjensen,cn=users,dc=example,dc=com 例如,example.com域中的用户bjensen通常具有以下DN:cn = bjensen,cn = users,dc = example,dc = com

My guess is that either Active Directory or the Python LDAP library may not return invalid credentials if the DN part is incorrect. 我的猜测是,如果DN部分不正确,则Active Directory或Python LDAP库可能不会返回无效的凭据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM