Skip to main content

LDAP

This package provides a Js implementation for the LDAP protocol.

Official Websitehttps://ldap.com/
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 parameters you can see here.

Here is 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: ["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: "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);
});
});