Guest User

Untitled

a guest
Mar 29th, 2018
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. var ActiveDirectory = require('activedirectory');
  2. var config = { url: 'ldap://myhotmail.onmicrosoft.com',
  3. baseDN: 'dc=myhotmail,dc=onmicrosoft,dc=com',
  4. username: 'roledene@myhotmail.onmicrosoft.com',
  5. password: 'myPassword'
  6. }
  7. var ad = new ActiveDirectory(config);
  8.  
  9. var username = 'roledene@myhotmail.onmicrosoft.com';
  10. var password = 'myPassword';
  11.  
  12. ad.authenticate(username, password, function(err, auth) {
  13. if (err) {
  14. console.log('ERROR: '+JSON.stringify(err));
  15. return;
  16. }
  17.  
  18. if (auth) {
  19. console.log('Authenticated!');
  20. }
  21. else {
  22. console.log('Authentication failed!');
  23. }
  24. });
  25.  
  26. ERROR: {"code":"ENOTFOUND","errno":"ENOTFOUND","syscall":"getaddrinfo","hostname":"myhotmail.onmicrosoft.com","host":"myhotmail.onmicrosoft.com","port":389}
Add Comment
Please, Sign In to add comment