shaozi / ldap-authentication

🔐🔐🔐 A simple Nodejs Async LDAP authentication library
BSD 2-Clause "Simplified" License
110 stars 28 forks source link

How to add `Credentials` into the request? #27

Closed Rongjianying closed 2 years ago

Rongjianying commented 2 years ago
const login = async (username, password) => {
    return await authenticate({
        ldapOpts: { url: ldapConfig.url, tlsOptions: ldapConfig.tlsOptions },
        userDn: 'uid=${username},${ldapConfig.bindDN}',
        userPassword: password,
        userSearchBase: ldapConfig.searchBase,
        usernameAttribute: 'uid'
    });
};

This will return error: [1] Error occurred in handler for 'login': LDAPError [InvalidCredentialsError]: 80090308: LdapErr: DSID-0C090436, comment: AcceptSecurityContext error, data 52e, v23f0

So my question is How to add Credentials into the request?

Thx a lot !!!

Rongjianying commented 2 years ago

Credentials is equal to adminPwd, sorry for disturb