gpt4 book ai didi

node.js - 使用 ldap.js 的 Active Directory 身份验证

转载 作者:搜寻专家 更新时间:2023-10-31 23:49:04 24 4
gpt4 key购买 nike

我一直在尝试使用 ldap.js 向 Active Directory Windows 2008 服务器进行身份验证。唯一的目标是向服务器进行身份验证,我正在使用客户端的东西(不是创建新服务器,这就是 documentation 的全部内容)。我是 LDAP 的新手,因此,使用用户名“MYDOMAIN\myuser”进行身份验证在 ldap.js 中不起作用,但在 ldapsearch 中起作用:ldapsearch -H ldap://192.168.1.212:389 -x -D 'MYDOMAIN\myuser' -w pa33w0rd -LLL -b "dc=mydomain"'(sAMAccountName=myuser)' 验证成功但随后吐出 Referral (10)

在 ldap.js 中尝试使用 client.bind("MYDOMAIN\myuser", 'pa33w0rd', function(err) { ... } ); 失败并返回 49 InvalidCredentialsError 80090308 : LdapErr: DSID-0C0903A9,评论:AcceptSecurityContext 错误,...

尝试将 MYDOMAIN\myuser 重写为专有名称 dn: cn=myuser, dc=mydomain 也失败,在 ldap 搜索中也出现身份验证错误。将 DOMAIN\USER(域反斜杠用户格式)转换为 DN 的正确方法是什么?

最佳答案

来自 http://www.rlmueller.net/NameTranslateFAQ.htm :

  1. Distinguished Names - format as specified in RFC 1779. For example cn=TestUser,ou=Sales,dc=MyDomain,dc=com.
  2. NT format - the name format used in Windows NT 4.0. For example MyDomain\TestUser, where MyDomain is the NetBIOS name of the domain and TestUser is the NT name of the object (the pre-Windows 2000 name). The value of the sAMAccountName attribute is the NT name of the object.

因此,NT格式(域反斜杠用户)登录名MYDOMAIN\myuser可以映射到cn=myuser,cn=Users,dc=mydomain,dc=comcn=myuser,cn=Users,dc=mydomain,dc=local 或其他一些。建议你看一下AD服务器的hosts文件或者DNS域名。您还应该更改 -b(基础)以包括 dc=com 或 dc=local,或任何修复引用错误的内容。

关于node.js - 使用 ldap.js 的 Active Directory 身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18970127/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com