n LDAP URL is a URL that begins with the ldap:// protocol prefix (or ldaps://, if the server is communicating over an SSL connection) and specifies a search request sent to an LDAP server.
When you access the directory server using a web-based client such as the directory server gateway, you must provide an LDAP URL identifying the directory server you wish to access. You can set the default LDAP URL to use with the directory server gateway using the baseurl parameter.
In addition, you may use LDAP URLs when managing directory server referrals or access control instructions.
This appendix contains the following sections:
ldap[s]://<hostname>:<port>/<base_dn>?<attributes>?<scope>?<filter>(The
ldap:// protocol is used to connect to LDAP servers over unsecured connections, and the ldaps:// protocol is used to connect to LDAP servers over SSL connections.)
Table C.1 lists the components of an LDAP URL.
Note that <attributes>, <scope>, and <filter> are identified by their positions in the URL. If you do not want to specify any attributes, you still need to include the question marks delimiting that field.
For example, to specify a subtree search starting from "o=airius.com" that returns all attributes for entries matching "(sn=Jensen)", use the following URL:
ldap://ldap.airius.com/o=airius.com??sub?(sn=Jensen)Note that the two consecutive question marks -- ?? -- indicate that no attributes have been specified. Since no specific attributes are identified in the URL, all attributes are returned in the search.
%20 within the URL. Thus, the distinguished name "o=airius corporation" must be encoded as "o=airius%20corporation". The following table lists the characters that are considered unsafe within URLs and provides the associated escape characters to use in place of the unsafe character.:
| Unsafe character | Escape characters |
|---|---|
| space | %20 |
| < | %3c |
| > | %3e |
| " | %22 |
| # | %23 |
| % | %25 |
| { | %7b |
| } | %7d |
| | | %7c |
| \ | %5c |
| ^ | %5e |
| ~ | %7e |
| [ | %5b |
| ] | %5d |
| ` | %60 |
Examples of LDAP URLs
The following LDAP URL specifies a base search for the entry with the distinguished name "o=airius.com".
ldap://ldap.airius.com/o=airius.com
"o=airius.com".
"(objectclass=*)" is used.
postalAddress attribute of the airius.com entry:
ldap://ldap.airius.com/o=airius.com?postalAddress
"o=airius.com".
"(objectclass=*)" is used.
cn, mail, and telephoneNumber attributes of the entry for Barbara Jensen:
ldap://ldap.airius.com/cn=Barbara%20Jensen,o=airius.com?cn,mail,telephoneNumber
"cn=Barbara Jensen,o=airius.com".
"(objectclass=*)" is used.
Jensen and are at any level under "o=airius.com":
ldap://ldap.airius.com/o=airius.com??sub?(sn=Jensen)
sub, the search encompasses the base entry "o=airius.com" and entries at all levels under the base entry.
"o=airius.com":
ldap://ldap.airius.com/o=airius.com?objectClass?one
one, the search encompasses all entries one level under the base entry "o=airius.com". The search scope does not include the base entry.
"(objectclass=*)" is used.