如何解决Python3 LDAP3 NTLM 有效,但默认身份验证方案返回 invalidCredentials
我正在使用带有 ldap3 库和 Active Directory 的 python 3.6.12。 这是我的代码片段:
#user = f'cn={ldap_username},OU=User-Accounts,{root_dn}' # Failed with invalidCredentials
user = f'{ldap_username}' # Success
print(user)
server = Server(ldap_server,get_info=ALL)
connection = Connection(server,user=user,password=ldap_password,authentication=NTLM)
if not connection.bind():
print(f" *** Cannot bind to ldap server! {connection.last_error},result: {connection.result}")
l_success_msg = f' ** Failed Authentication: {connection.last_error}'
else:
print(f" *** Successful bind to ldap server")
l_success_msg = 'Success'
cn=username,DC=domain,DC=com
{'result': 49,'description': 'invalidCredentials','dn': '','message': '80090308: LdapErr: DSID-0C090446,comment: AcceptSecurityContext error,data 52e,v2580\x00','referrals': None,'saslCreds': None,'type': 'bindResponse'}
简单的身份验证方案有什么问题?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。