Как получить доступ к AWS Microsoft AD с помощью пакетов npm, таких как activedirectory, ldapjs или ldap-client

У меня есть AWS Служба каталогов для Microsoft AD и и EC2 Windows Server 2016 присоединился к AD и положить пользователей в AD,

мой вопрос, как я могу получить доступ к AD, используя пакеты npm, такие как activedirectory, ldapjs или же ldap-client

AWS Microsoft для AD

Ниже приведен мой фрагмент кода:

let ActiveDirectory = require('activedirectory');
let adConfig = {
    url: 'ldap://ec2-*-*-*-152.ap-southeast-1.compute.amazonaws.com',
    baseDN: 'DC=corp,DC=***,DC=com',
    username: 'CN=Admin,OU=Users,OU=corp,DC=corp,DC=***,DC=com',
    password: '*******'
};

let ad = new ActiveDirectory(adConfig);
let username = 'j***@corp.***.com';
let password = '******';

ad.authenticate(username, password, function(err, auth) {
    if (err) {
        console.log('=== executed this err block ===');
        console.error('ERROR: ' + JSON.stringify(err));
        return;
    }

    if (auth) {
        console.log('Authenticated');
        return;
    }

    console.log('Authentication failed');
});

возвращает ошибку: {"code": "ETIMEDOUT", "errno": "ETIMEDOUT", "syscall": "connect", "address": ".. *. 152", "port": 389}

Предоставленный URL-адрес - это общедоступный DNS моего экземпляра ec2 (с группой безопасности, открытой для всех номеров портов), соединенной с AWS AD.

0 ответов

Другие вопросы по тегам