exports.ldapLogin = async (req, res, next) => {
try {
var uid = '90002346';
var username = `icicibankltd\\${uid}`;
var password = 'Oneplus@7t';
var config = {
url: 'LDAP://icicibankltd.com:389',
baseDN: 'DC=icicibankltd,DC=com',
username,
password,
};
var ad = new ActiveDirectory(config);
// Authenticate
ad.authenticate(username, password, function (err, auth) {
if (err) {
console.log('ERROR: ' + JSON.stringify(err));
return;
}
if (auth) {
console.log('Authenticated!', auth);
} else {
console.log('Authentication failed!');
}
});
} catch (error) {
console.log(error, "25");
handleError(req, res, error);
}
};
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)