Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid DN #244

Open
cedricbieder opened this issue Oct 28, 2022 · 1 comment
Open

invalid DN #244

cedricbieder opened this issue Oct 28, 2022 · 1 comment

Comments

@cedricbieder
Copy link

I set up an univention ldap server and try to connect to it with my nodejs server. For that I first tried the ldap-authentication ldap-authentication package which works fine with the following config:

await authenticate({
    ldapOpts: { url: ip },
    userDn: 'uid=Administrator,cn=users,dc=example,dc=intranet',
    userPassword: 'password',
    userSearchBase: 'dc=example,dc=intranet',
    username: 'Administrator',
})

Because I need some more functions I tried activedirectory with the following config (and some others but nothing worked):


var ActiveDirectory = require('activedirectory');
var config = { url: ip,
  bindDN: 'uid=Administrator,cn=users,dc=example,dc=intranet',
  baseDN: 'dc=example,dc=intranet',
  username: 'Administrator',
  password: 'password' 
}

var ad = new ActiveDirectory(config)
var username = 'Administrator';
var password = 'password';

ad.authenticate(username, password, function(err, auth) {
 if (err) {
    console.log('ERROR: ' + JSON.stringify(err));
    return;
 }
 if (auth) {
    console.log('Authenticated!');
 } else {
    console.log('Authentication failed!');
 }
});

For me both should work the same way, but the activedirectory-package just throws:

ERROR: {"lde_message":"invalid DN","lde_dn":null}

Also theldapsearch -H ip -x -D "uid=Administrator,cn=users,dc=example,dc=intranet" -W password -b "dc=example,dc=intranet"works fine.

So, what can be reason or way to solve this?

@goddensys
Copy link

Hi!

I have the same question! Any idea bout that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants