Skip to main content

LDAP

This package provides a Js implementation for the LDAP protocol.

Official Websitehttp://ldapjs.org/
Documentationhttp://ldapjs.org/
Version2.3.3
Tagsauthentication
Network Connection needs

This integration needs network access to the server where the service is running.

See the Network access page for details about how to achieve that.

Credential configuration

To configure this credential you need the URL (or URLs) of the LDAP server. Optionally you can set any of the extra config params you can see here.

Here you have an example of a filled credential configuration form in YepCode:

LDAP snippets available in editor

note

The title is the triggering text for YepCode to autocomplete the script

Integration

New integration from credential
const ldapClient = await yepcode.integration.ldap('credential-slug')
New integration from plain authentication data
const ldapClient = require("ldapjs").createClient({
url: ["{2:url}"]
});
ldapClient.on("error", (err) => {
console.log("error", err)
});
ldapClient.on("connect", () => {
console.log("connected")
});

Add entry

Add entry
const entry = {
// Attributes
};
ldapClient.add("dn", entry, (err) => {
if (err) {
throw err;
}
// Completed
});

Bind

Bind
ldapClient.bind("dn", "secret", (err) => {
if (err) {
throw err;
}
// Completed
});
Search
const options = {
filter: "{2:filter}",
};

ldapClient.search("dn", options, (err, res) => {
res.on("searchEntry", (entry) => {
console.log("entry: " + JSON.stringify(entry.object));
});
res.on("error", (err) => {
console.error("error: " + err.message);
});
});