Connection settings, the user lookup, and the candidate password.
The matched entry on a successful password bind, or null when no entry matches or
the password is wrong.
const entry = await authenticate({
hostname: 'ldap.example.org',
bindDN: 'cn=admin,dc=example,dc=org',
bindPassword: 'service-secret',
base: 'ou=people,dc=example,dc=org',
userFilter: eq('uid', 'jdoe'),
password: 'the-user-password'
});
if (entry) {
// authenticated; entry.dn is the bound user
}
Authenticates a user by the bind-search-bind pattern.
Connects and binds as the service account (LdapConnectOptions.bindDN / AuthenticateOptions.bindPassword), or anonymously when no
bindDNis given; searches underbasefor the entry matchinguserFilter(capped at one result); then re-binds as that entry's DN with the user's AuthenticateOptions.password. The session is always closed before returning.