|
||
|
|
When you access the Netscape Directory Server (Directory Server) using a web-based client such as Directory Server Gateway, you must provide an LDAP URL identifying the Directory Server you wish to access.
You also use LDAP URLs when managing Directory Server referrals or access control instructions. This appendix contains the following sections:
LDAP URLs have the following syntax:
ldap[s]://hostname:port/base_dn?attributes?scope?filter
The
ldap://protocol is used to connect to LDAP servers over unsecured connections, and theldaps://protocol is used to connect to LDAP servers over SSL connections. Table C-1 lists the components of an LDAP URL.
The attributes, scope, and filter components 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
"dc=example,dc=com"that returns all attributes for entries matching"(sn=Jensen)", use the followingLDAP URL:ldap://ldap.example.com/dc=example,dc=com??sub?(sn=Jensen)
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.
Any "unsafe" characters in the URL need to be represented by a special sequence of characters. This is called escaping unsafe characters.
For example, a space is an unsafe character that must be represented as
%20within the URL. Thus, the distinguished name"o=example.com corporation"must be encoded as"o=example.com%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:
The following LDAP URL specifies a base search for the entry with the distinguished name
dc=example,dc=com.ldap://ldap.
example.com/dc=example,dc=com
- Because no port number is specified, the standard LDAP port number (389) is used.
![]()
- Because no attributes are specified, the search returns all attributes.
![]()
- Because no search scope is specified, the search is restricted to the base entry
dc=example,dc=com.![]()
- Because no filter is specified, the directory uses the default filter (
objectclass=*).![]()
The following LDAP URL retrieves the
postalAddressattribute of the entry with the DNdc=example,dc=com:ldap://ldap.example.com/
dc=example,dc=com?postalAddress
- Because no search scope is specified, the search is restricted to the base entry
dc=example,dc=com.![]()
- Because no filter is specified, the directory uses the default filter (
objectclass=*).![]()
The following LDAP URL retrieves the
cn,telephoneNumberattributes of the entry for Barbara Jensen:ldap://ldap.example.com/cn=Barbara%20Jensen,
dc=example,dc=com?cn,ma il,telephoneNumber
- Because no search scope is specified, the search is restricted to the base entry
cn=Barbara Jensen,dc=example,dc=com.![]()
- Because no filter is specified, the directory uses the default filter
(objectclass=*).![]()
The following LDAP URL specifies a search for entries that have the surname
Jensenand are at any level underdc=example,dc=com:ldap://ldap.example.com/
dc=example,dc=com??sub?(sn=Jensen)
- Because no attributes are specified, the search returns all attributes.
![]()
- Because the search scope is
sub, the search encompasses the base entrydc=example,dc=comand entries at all levels under the base entry.![]()
The following LDAP URL specifies a search for the object class for all entries one level under
dc=example,dc=com:ldap://ldap.example.com/
dc=example,dc=com?objectClass?one
- Because the search scope is
one, the search encompasses all entries one level under the base entrydc=example,dc=com. The search scope does not include the base entry.![]()
- Because no filter is specified,the directory uses the default filter (
objectclass=*).![]()
© 2001 Sun Microsystems, Inc. Portions copyright 1999, 2002-2003 Netscape Communications Corporation. All rights reserved.
Read the Full Copyright and Thrid-Party Acknowledgments.
Last Updated October 30, 2003