Skip to content

Binding problem  #24

Description

@mkermani144

When I try to use node-ldapauth, I get the following error:

Error: LDAP connection is not yet bound
...

My code seems like this:

var config = {
        ldap: {
            url: "ldap://1.2.3.4",
            adminDn: "cn=admin, dc=sub, dc=domain",
            adminPassword: "Secret",
            searchBase: "dc=sub, dc=domain",
            searchFilter: "(cn={{username}})" 
        }
    };
var auth = new ldap({
    url: config.ldap.url,
    adminDn: config.ldap.adminDn,
    adminPassword: config.ldap.adminPassword,
    searchBase: config.ldap.searchBase,
    searchFilter: config.ldap.searchFilter
});
auth.authenticate('cn=sample , ou=sub1, ou=sub2, dc=sub, dc=domain', 'samplesecret', function(err, user) {
        if (err) {
            console.log(err);
            res.writeHead('401');
            res.end()
        } else {
            res.writeHead('200');
            res.end();
        }
    });

I am sure that the credentials are valid.
I also tried cn=sample instead of cn={{username}} but the problem does not resolve.
Any idea?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions