2017-05-10 2 views
1

내 노드 응용 프로그램 중 하나에서 npmjs의 activedirectory module을 사용하여 Active Directory에 대한 인증을 받았습니다. 내 질문 - AD로 인증하는 동안 일반 문자열 암호를 보내야합니까? 내 생각에 광고가 사용자 암호를 저장하면 다른 암호로 암호화해야합니다. 인증을 위해 암호화 된 암호를 보낼 수 있습니까?NPM - ActiveDirectory 모듈 인증

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!'); 
    } 
}) 

답변

1

솔루션은 LDAPS (보안 LDAP)를 사용하고 처음 연결할 때 검증을 위해 CA를 제공하는 것입니다 - 여기가 무슨 뜻인지입니다. 유선을 통해 전송되는 자격 증명은 암호화되며 MITM 공격은 인증서 확인을 강요하는 경우 작동하지 않습니다.

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