【发布时间】:2019-01-16 17:00:39
【问题描述】:
我正在尝试使用 ldapauth-fork 对 LDAP 用户进行身份验证。我的 LDAP 管理员帐户有问题,虽然我知道它是正确的并且可以在 LDAP 浏览器中正常工作,但我无法使其与 ldapauth-fork 一起工作。
var basicAuth = require('basic-auth');
var LdapAuth = require('ldapauth-fork');
var username= 'usernameToSearch';
var password= 'userPassword';
var ldap = new LdapAuth({
url: 'ldap://......',
bindDN: 'sAMAccountName=AdminName,OU=Domian,DC=domain,DC=local',
bindCredentials: 'AdminPassword',
searchBase: 'OU=Domain,DC=domian,DC=local',
searchFilter: '(sAMAccountName={{' + username + '}})',
reconnect: true
});
ldap.authenticate(username, password, function (err, user) {
if (err) {
console.log(err);
res.send({
success: false,
message: 'authentication failed'
});
} else if (!user.uid) {
console.log("user not found Error");
res.send({
success: false,
message: 'authentication failed'
});
} else if (user.uid) {
console.log("success : user " + user.uid + " found ");
}
});
这是出现的错误
InvalidCredentialsError:80090308:LdapErr:DSID-0C09042F,注释: AcceptSecurityContext 错误,数据 52e,v2580
lde_message: '80090308: LdapErr: DSID-0C09042F,评论: AcceptSecurityContext 错误,数据 52e,v2580\u0000',lde_dn: null
感谢任何帮助。
【问题讨论】:
-
您找到解决方案了吗?如果是这样,请将其发布为答案
-
抱歉来晚了。明天分享一下
-
能否提供解决方案