Whatever message this page gives is out now! Go check it out!
<cfldap
action = "action"
server = "server name"
attributes = "attribute, attribute"
delimiter = "delimiter character"
dn = "distinguished name"
filter = "filter"
maxRows = "number"
modifyType = "replace|add|delete"
name = "name"
password = "password"
port = "port number"
rebind = "yes|no"
referral = "number of allowed hops"
returnAsBinary = "column name, column name"
scope = "scope"
secure = "multifield security string"
separator = "separator character"
sort = "attribute[, attribute]..."
sortControl = "nocase|desc|asc"
start = "distinguished name"
startRow = "row number"
timeout = "milliseconds"
username = "user name"
clientcert = "path to client certificate"
clientcertpassword = "password for the client certificate"
usetls = "true|false">| Attribute | Req/Opt | Default | Description |
action | Required | query |
|
server | Required | Host name or IP address of LDAP server. | |
attributes | Required if action = "Query", "Add", "ModifyDN", or "Modify" | For queries: comma-delimited list of attributes to return. For queries, to get all attributes, specify "*". If action = "add" or "modify", you can specify a list of update columns. Separate attributes with a semicolon. If action = "ModifyDN", ColdFusion passes attributes to the LDAP server without syntax checking. | |
delimiter | Optional | ; (semicolon) | Separator between attribute name-value pairs. Use this attribute if either of these situations exist:
|
dn | Required if action = "Add","Modify", "ModifyDN", or "delete" | Distinguished name, for update action, for example, "cn = Bob Jensen, o = Ace Industry, c = US" | |
filter | Optional | "objectclass = *" | Search criteria for action = "query". List attributes in the form: "(attribute operator value)" For example: "(sn = Smith)" |
maxRows | Optional | Maximum number of entries for LDAP queries. | |
modifyType | Optional | replace | How to process an attribute in a multi-value list:
|
name | Required if action = "Query" | Name of LDAP query. The tag validates the value. | |
password | Required if secure = "CFSSL_BASIC" | Password that corresponds to user name. If secure = "CFSSL_BASIC", V2 encrypts the password before transmission. | |
port | Optional | 389 | Port. |
rebind | Optional | no |
|
referral | Optional | Integer. Number of hops allowed in a referral. A value of 0 disables referred addresses for LDAP; no data is returned. | |
returnAsBinary | Optional | A space-delimited list of columns that are to be returned as binary values. | |
scope | Optional | oneLevel | Scope of search, from entry specified in start attribute for action = "Query".
|
secure | Optional | Security to employ, and required information. If you specify this attribute, its value must be one of the following:
| |
separator | Optional | , (comma) | Delimiter to separate attribute values of multi-value attributes. Used by query, add, and modify actions, and by cfldap to output multi-value attributes. For example, if $ (dollar sign), the attributes attribute could be "objectclass = top$person", where the first value of objectclass is top, and the second value is person. This avoids confusion if values include commas. |
sort | Optional | Attributes by which to sort query results. Use a comma delimiter. | |
sortControl | Optional | asc |
|
start | Required if action = "Query" | Distinguished name of entry to be used to start a search. | |
startRow | Optional | 1 | Used with action = "query". First row of LDAP query to insert into a ColdFusion query. |
timeout | Optional | 60000 | Maximum length of time, in milliseconds, to wait for LDAP processing. |
username | Required if secure = "CFSSL_BASIC" | (anonymous) | User ID. |
| clientcert | Optional | The full path to the key store file that contains the client certificate. | |
| clientcertpassword | Optional | Password for the client certificate. | |
| usetls | Optional | true/false | Whether to use the startTls extension for initiating SSL over normal LDAP port. |
| Variable name | Description |
queryname.recordCount | Number of records returned by query |
queryname.currentRow | Current row of query that cfoutput is processing |
queryname.columnList | Column names in query |
keytool -import -keystore cacerts -alias ldap -file ldap.crt -keypass bl19mq<h3>cfldap Example</h3>
<p>Provides an interface to LDAP directory servers. The example uses the
University of Connecticut public LDAP server. For more public LDAP servers,
see <a href="http://www.emailman.com">http://www.emailman.com</a>.</p>
<p>Enter a name and search the public LDAP resource.
An asterisk before or after the name acts as a wildcard.</p>
<!--- If form.name exists, the form was submitted; run the query. --->
<cfif IsDefined("form.name")>
<!--- Check to see that there is a name listed. --->
<cfif form.name is not "">
<!--- Make the LDAP query. --->
<cfldap
server = "ldap.uconn.edu"
action = "query"
name = "results"
start = "dc=uconn,dc=edu"
filter = "cn=#name#"
attributes = "cn,o,title,mail,telephonenumber"
sort = "cn ASC">
<!--- Display results. --->
<center>
<table border = 0 cellspacing = 2 cellpadding = 2>
<tr>
<th colspan = 5>
<cfoutput>#results.recordCount# matches found </cfoutput></TH>
</tr>
<tr>
<th><font size = "-2">Name</font></TH>
<th><font size = "-2">Organization</font></TH>
<th><font size = "-2">Title</font></TH>
<th><font size = "-2">E-Mail</font></TH>
<th><font size = "-2">Phone</font></TH>
</tr>
<cfoutput query = "results">
<tr>
<td><font size = "-2">#cn#</font></td>
<td><font size = "-2">#o#</font></td>
<td><font size = "-2">#title#</font></td>
<td><font size = "-2">
<A href = "mailto:#mail#">#mail#</A></font></td>
<td><font size = "-2">#telephonenumber#</font></td>
</tr>
</cfoutput>
</table>
</center>
</cfif>
</cfif>
<form action="#cgi.script_name#" method="POST">
<p>Enter a name to search in the database.</p>
<input type="Text" name="name">
<input type="Submit" value="Search" name="">
</form><cfldap action="modifyDN" attributes="cn=Accounting Officers" dn="cn=QA Managers,ou=Groups,dc=example,
dc=com" server="localhost" port="10389" username="uid=admin,ou=system" password
="Password@123" ><cfldap action="modifyDN" attributes="cn=Accounting Managers,ou=Special Users,dc=example,dc=com"
dn="cn=Accounting Managers,ou=Groups,dc=example,
dc=com" server="localhost" port="10389" username="uid=admin,ou=system" password
="Password@123" >