【问题标题】:NPM - ActiveDirectory Module AuthenticationNPM - ActiveDirectory 模块身份验证
【发布时间】:2017-05-10 09:34:45
【问题描述】:

我在我的一个节点应用程序中使用来自 npmjs 的activedirectory module 对 Active Directory 进行身份验证,我的问题是 - 在使用 AD 进行身份验证时是否需要发送纯字符串密码?我的意思是如果广告存储了用户密码,它必须以某种方式对其进行加密,我们可以发送加密密码进行身份验证吗?这就是我的意思-

ad.authenticate(username, password, function(err, auth) { 
// instead of plain password can it be encrypted password?
 if (err) {
    console.log('ERROR: '+JSON.stringify(err));
    return;
  }

  if (auth) {
    console.log('Authenticated!');
  }
  else {
    console.log('Authentication failed!');
  }
})

【问题讨论】:

    标签: node.js authentication encryption npm active-directory


    【解决方案1】:

    解决方案是使用 ldaps(安全 LDAP)并在首次连接时提供 CA 进行验证。通过网络发送的凭据将被加密,如果您强制进行证书验证,MITM 攻击将不起作用。

    const ActiveDirectory = require("activedirectory");
    const ad = new ActiveDirectory({
        url: "ldaps://dc.domain.com",
        baseDN: "dc=domain,dc=com",
        username: "username@domain.com",
        password: "password",
        tlsOptions: {
            ca: [fs.readFileSync("CA.crt")],
            rejectUnauthorized: true // Force Certificate Verification 
        }
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-09-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多