The Engines.LDAP object provides you with a method to search for and retrieve information from your LDAP directory server. It is especially useful for those developers who are interested in writing a Klip that displays content from Active Directory.
Note that Klipfolio Dashboard makes use of RFC 2254 to define LDAP queries against Active Directory. This RFC fully defines the syntax required to create successful queries but not the schema and attributes to be queried.
As with Klips that display data from other types of data sources, a Klip using this object will display the data according to the stylesheet definitions in its <style> block. For information about how to write a Klip, see our how-to article, Klip Development Fundamentals.
Example:
The following example Klip demonstrates how to write a Klip that retrieves and lists the employee names, their titles and their phone numbers
from Active Directory. Note that there is no code for authentication, as Klipfolio Dashboard automatically authenticates using the credentials of
the user who is currently logged into Windows.
<?xml version="1.0" encoding="UTF-8" ?>
<klip>
<identity>
<title>
API - Engines.LDAP
</title>
<description>
Search your employee database via LDAP.
</description>
</identity>
<locations>
<icon>
http://www.klipfolio.com/static/klips/klipfolio/sample_icon.png
</icon>
<banner>
http://www.klipfolio.com/static/klips/klipfolio/sample_banner.png
</banner>
</locations>
<setup>
<sort>
EmployeeName
</sort>
</setup>
<style>
row
{
type: item;
definition: all;
}
cn
{
itemcol: 1;
noterow: 1;
emphasis: strong;
notelabel: false;
label: "Name";
name: "EmployeeName";
wrap: false;
}
title
{
noterow: 2;
notelabel: false;
}
telephoneNumber
{
itemcol: 3;
noterow: 3;
label: "Phone";
wrap: false;
}
</style>
<klipscript>
<![CDATA[
function onLoad () {
query = "(&(objectClass=organizationalPerson)(|(|(|(givenName=*)(SN=*))(mail=*))(telephoneNumber=*)))";
// Send the LDAP query
var ar = Engines.LDAP.search (
query,
"distinguishedName,cn,title,mail,telephoneNumber,ipPhone,wWWHomePage"
);
// Process the response from the LDAP query
Items.clear (true);
Engines.Data.process (ar);
}
function onRefresh () {
return true;
}
]]>
</klipscript>
</klip>
Since:
5.4
See also:
LDAP Query Basics
RFC 2254 — The String Representation of LDAP Search Filters for attribute types and object classes for LDAP.
Directory, Identity and Access Services for additional information from Microsoft about Active Directory vs. the X.500 series/LDAP.
For common practices and a superset of what Active Directory supports:
RFC 2256 — A Summary of the X.500(96) User Schema for use with LDAPv3
RFC 2252 — Lightweight Directory Access Protocol (v3): Attribute Syntax Definitions
| Function Summary | |
function
|
search( <String> query[, <String> attributes[, <String> server ]] )
Runs a query against the default Active Directory provider based on your domain controller. |
| Function Detail |
search
function search( <String> query[, <String> attributes[, <String> server ]] )
- Runs a query against the default Active Directory provider based on your domain controller.
To run a query against the default Active Directory provider based on your domain controller with a specific attribute filter to restrict the scope of the search, use the optional attributes parameter.
To run a query against a specific LDAP server with a specific attribute filter, additionally use the server parameter.
Since:
5.4
-
Parameters:
query - a string based on RFC 2254 syntax
attributes - a string containing a comma (no spaces) delimited list of attribute names
server - a string containing your server address (e.g. "LDAP://DC1.mycompany.local")
|
Klipfolio Dashboard API | ||||||||
| PREV OBJECT NEXT OBJECT | FRAMES NO FRAMES | ||||||||
| SUMMARY: PROPERTY | FUNCTION | DETAIL: PROPERTY | FUNCTION | ||||||||
© 2011 Klipfolio Inc. All Rights Reserved.