You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using node js activedirectory module for AD authentication and fetching users & groups. Able to authenticate successfully but unable to get users & groups using .findUser(), .findUsers(), .findGroups() methods. I've added few users and a group using ADSI editor in windows 10. Any clue what could be going wrong?
Screenshot of ADSI Editor :
Code :
var ActiveDirectory = require('activedirectory');
var config = {
url: 'ldap://localhost',
baseDN: 'cn=admin,dc=ec2,dc=internal',
username: 'cn=akshay,cn=testContainer,cn=admin,dc=ec2,dc=internal',
password: '123456'
};
var ad = new ActiveDirectory(config);
var username = 'cn=akshay,cn=testContainer,cn=admin,dc=ec2,dc=internal';
var password = '123456';
ad.authenticate(username, password, function (err, auth) {
if (err) {
console.log('ERROR: ' + JSON.stringify(err));
return;
}
if (auth) {
console.log('Authenticated!');
ad.findUser({
dn: "cn=akshay,cn=testContainer,cn=admin,dc=ec2,dc=internal"
}, function (err, user) {
if (err) {
console.log('ERROR: ' + JSON.stringify(err));
return;
}
if (!user) console.log('User: not found.');
else console.log(JSON.stringify(user));
});
} else {
console.log('Authentication failed!');
}
});
Output :
Authenticated!
User: not found.
The text was updated successfully, but these errors were encountered:
I am using node js activedirectory module for AD authentication and fetching users & groups. Able to authenticate successfully but unable to get users & groups using .findUser(), .findUsers(), .findGroups() methods. I've added few users and a group using ADSI editor in windows 10. Any clue what could be going wrong?
Screenshot of ADSI Editor :
Code :
Output :
Authenticated!
User: not found.
The text was updated successfully, but these errors were encountered: