2 Internet-Draft Editor: J. Sermersheim
3 Intended Category: Standard Track Novell, Inc
4 Document: draft-ietf-ldapbis-protocol-22.txt Feb 2004
5 Obsoletes: RFC 2251, 2830, [LIMR]
13 This document is an Internet-Draft and is in full conformance with
14 all provisions of Section 10 of RFC2026.
16 Internet-Drafts are working documents of the Internet Engineering
17 Task Force (IETF), its areas, and its working groups. Note that other
18 groups may also distribute working documents as Internet-Drafts.
19 Internet-Drafts are draft documents valid for a maximum of six months
20 and may be updated, replaced, or obsoleted by other documents at any
21 time. It is inappropriate to use Internet-Drafts as reference
22 material or to cite them other than as "work in progress."
24 The list of current Internet-Drafts can be accessed at
25 http://www.ietf.org/ietf/1id-abstracts.txt
27 The list of Internet-Draft Shadow Directories can be accessed at
28 http://www.ietf.org/shadow.html.
30 Distribution of this memo is unlimited. Technical discussion of this
31 document will take place on the IETF LDAP Revision Working Group
32 (LDAPbis) mailing list <ietf-ldapbis@openldap.org>. Please send
33 editorial comments directly to the editor <jimse@novell.com>.
38 This document describes the protocol elements, along with their
39 semantics and encodings, of the Lightweight Directory Access Protocol
40 (LDAP). LDAP provides access to distributed directory services that
41 act in accordance with X.500 data and service models. These protocol
42 elements are based on those described in the X.500 Directory Access
48 1. Introduction....................................................2
49 1.1. Relationship to Obsolete Specifications.......................3
50 2. Conventions.....................................................3
51 3. Protocol Model..................................................3
52 4. Elements of Protocol............................................4
53 4.1. Common Elements...............................................4
54 4.1.1. Message Envelope............................................5
55 4.1.2. String Types................................................6
57 Sermersheim Internet-Draft - Expires Aug 2004 Page 1
\f
58 Lightweight Directory Access Protocol Version 3
60 4.1.3. Distinguished Name and Relative Distinguished Name..........6
61 4.1.4. Attribute Descriptions......................................7
62 4.1.5. Attribute Value.............................................7
63 4.1.6. Attribute Value Assertion...................................7
64 4.1.7. Attribute and PartialAttribute..............................8
65 4.1.8. Matching Rule Identifier....................................8
66 4.1.9. Result Message..............................................8
67 4.1.10. Referral..................................................10
68 4.1.11. Controls..................................................11
69 4.2. Bind Operation...............................................13
70 4.3. Unbind Operation.............................................16
71 4.4. Unsolicited Notification.....................................16
72 4.5. Search Operation.............................................17
73 4.6. Modify Operation.............................................26
74 4.7. Add Operation................................................27
75 4.8. Delete Operation.............................................28
76 4.9. Modify DN Operation..........................................29
77 4.10. Compare Operation...........................................30
78 4.11. Abandon Operation...........................................31
79 4.12. Extended Operation..........................................31
80 4.13. IntermediateResponse Message................................33
81 4.13.1. Usage with LDAP ExtendedRequest and ExtendedResponse......33
82 4.13.2. Usage with LDAP Request Controls..........................34
83 4.14. StartTLS Operation..........................................34
84 5. Protocol Element Encodings and Transfer........................36
85 5.1. Protocol Encoding............................................37
86 5.2. Transfer Protocols...........................................37
87 6. Security Considerations........................................38
88 7. Acknowledgements...............................................39
89 8. Normative References...........................................39
90 9. Informative References.........................................41
91 10. IANA Considerations...........................................41
92 11. Editor's Address..............................................41
93 Appendix A - LDAP Result Codes....................................42
94 A.1 Non-Error Result Codes........................................42
95 A.2 Result Codes..................................................42
96 Appendix B - Complete ASN.1 Definition............................46
97 Appendix C - Changes..............................................52
98 C.1 Changes made to made to RFC 2251:.............................52
99 C.2 Changes made to made to RFC 2830:.............................57
100 C.3 Changes made to made to [LIMR]:...............................58
105 The Directory is "a collection of open systems cooperating to provide
106 directory services" [X.500]. A directory user, which may be a human
107 or other entity, accesses the Directory through a client (or
108 Directory User Agent (DUA)). The client, on behalf of the directory
109 user, interacts with one or more servers (or Directory System Agents
110 (DSA)). Clients interact with servers using a directory access
115 Sermersheim Internet-Draft - Expires Aug 2004 Page 2
\f
116 Lightweight Directory Access Protocol Version 3
118 This document details the protocol elements of the Lightweight
119 Directory Access Protocol (LDAP), along with their semantics.
120 Following the description of protocol elements, it describes the way
121 in which the protocol elements are encoded and transferred.
124 1.1. Relationship to Obsolete Specifications
126 This document is an integral part of the LDAP Technical Specification
127 [Roadmap] which obsoletes the previously defined LDAP technical
128 specification, RFC 3377, in its entirety.
130 This document obsoletes all of RFC 2251 except the following:
131 Sections 3.2, 3.4, 4.1.3 (last paragraph), 4.1.4, 4.1.5, 4.1.5.1,
132 4.1.9 (last paragraph), 5.1, 6.1, and 6.2 (last paragraph) are
133 obsoleted by [Models].
134 Section 3.3 is obsoleted by [Roadmap].
135 Sections 4.2.1 (portions), and 4.2.2 are obsoleted by [AuthMeth].
137 Appendix C.1 summarizes substantive changes to the remaining
140 This document obsoletes RFC 2830, Sections 2 and 4 in entirety. The
141 remainder of RFC 2830 is obsoleted by [AuthMeth]. Appendix C.2
142 summarizes substantive changes to the remaining sections.
144 This document also obsoletes [LIMR] in entirety.
145 <<Note to RFC Editor: [LIMR] is to be replaced with the RFC
146 number assigned to draft-rharrison-ldap-intermediate-resp-
147 xx.txt, an RFC-to-be.>>
152 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
153 "SHOULD", "SHOULD NOT", "RECOMMENDED", and "MAY" in this document are
154 to be interpreted as described in [Keyword].
156 The terms "connection" and "LDAP connection" both refer to the
157 underlying transport protocol connection between two protocol peers.
159 The term "TLS connection" refers to a [TLS]-protected LDAP
162 The terms "association" and "LDAP association" both refer to the
163 association of the LDAP connection and its current authentication and
169 The general model adopted by this protocol is one of clients
170 performing protocol operations against servers. In this model, a
171 client transmits a protocol request describing the operation to be
173 Sermersheim Internet-Draft - Expires Aug 2004 Page 3
\f
174 Lightweight Directory Access Protocol Version 3
176 performed to a server. The server is then responsible for performing
177 the necessary operation(s) in the Directory. Upon completion of an
178 operation, the server typically returns a response containing
179 appropriate data to the requesting client.
181 Although servers are required to return responses whenever such
182 responses are defined in the protocol, there is no requirement for
183 synchronous behavior on the part of either clients or servers.
184 Requests and responses for multiple operations generally may be
185 exchanged between a client and server in any order, provided the
186 client eventually receives a response for every request that requires
189 The core protocol operations defined in this document can be mapped
190 to a subset of the X.500 (1993) Directory Abstract Service [X.511].
191 However there is not a one-to-one mapping between LDAP operations and
192 X.500 Directory Access Protocol (DAP) operations. Server
193 implementations acting as a gateway to X.500 directories may need to
194 make multiple DAP requests to service a single LDAP request.
197 4. Elements of Protocol
199 The protocol is described using Abstract Syntax Notation One
200 ([ASN.1]), and is transferred using a subset of ASN.1 Basic Encoding
201 Rules ([BER]). Section 5.1 specifies how the protocol elements are
202 encoded and transferred.
204 In order to support future extensions to this protocol, extensibility
205 is implied where it is allowed per ASN.1 (i.e. sequence, set, choice,
206 and enumerated types are extensible). In addition, ellipses (...)
207 have been supplied in ASN.1 types that are explicitly extensible as
208 discussed in [LDAPIANA]. Because of the implied extensibility,
209 clients and servers MUST (unless otherwise specified) ignore trailing
210 SEQUENCE components whose tags they do not recognize.
212 Changes to the protocol other than through the extension mechanisms
213 described here require a different version number. A client indicates
214 the version it is using as part of the bind request, described in
215 Section 4.2. If a client has not sent a bind, the server MUST assume
216 the client is using version 3 or later.
218 Clients may determine the protocol versions a server supports by
219 reading the 'supportedLDAPVersion' attribute from the root DSE (DSA-
220 Specific Entry) [Models].
225 This section describes the LDAPMessage envelope Protocol Data Unit
226 (PDU) format, as well as data type definitions, which are used in the
231 Sermersheim Internet-Draft - Expires Aug 2004 Page 4
\f
232 Lightweight Directory Access Protocol Version 3
234 4.1.1. Message Envelope
236 For the purposes of protocol exchanges, all protocol operations are
237 encapsulated in a common envelope, the LDAPMessage, which is defined
240 LDAPMessage ::= SEQUENCE {
243 bindRequest BindRequest,
244 bindResponse BindResponse,
245 unbindRequest UnbindRequest,
246 searchRequest SearchRequest,
247 searchResEntry SearchResultEntry,
248 searchResDone SearchResultDone,
249 searchResRef SearchResultReference,
250 modifyRequest ModifyRequest,
251 modifyResponse ModifyResponse,
252 addRequest AddRequest,
253 addResponse AddResponse,
254 delRequest DelRequest,
255 delResponse DelResponse,
256 modDNRequest ModifyDNRequest,
257 modDNResponse ModifyDNResponse,
258 compareRequest CompareRequest,
259 compareResponse CompareResponse,
260 abandonRequest AbandonRequest,
261 extendedReq ExtendedRequest,
262 extendedResp ExtendedResponse,
263 intermediateResponse IntermediateResponse
265 controls [0] Controls OPTIONAL }
267 MessageID ::= INTEGER (0 .. maxInt)
269 maxInt INTEGER ::= 2147483647 -- (2^^31 - 1) --
271 The ASN.1 type Controls is defined in Section 4.1.11.
273 The function of the LDAPMessage is to provide an envelope containing
274 common fields required in all protocol exchanges. At this time the
275 only common fields are the message ID and the controls.
277 If the server receives a PDU from the client in which the LDAPMessage
278 SEQUENCE tag cannot be recognized, the messageID cannot be parsed,
279 the tag of the protocolOp is not recognized as a request, or the
280 encoding structures or lengths of data fields are found to be
281 incorrect, then the server SHOULD return the Notice of Disconnection
282 described in Section 4.4.1, with the resultCode set to protocolError,
283 and MUST immediately close the connection.
285 In other cases where the client or server cannot parse a PDU, it
286 SHOULD abruptly close the connection where further communication
287 (including providing notice) would be pernicious. Otherwise, server
289 Sermersheim Internet-Draft - Expires Aug 2004 Page 5
\f
290 Lightweight Directory Access Protocol Version 3
292 implementations MUST return an appropriate response to the request,
293 with the resultCode set to protocolError.
298 All LDAPMessage envelopes encapsulating responses contain the
299 messageID value of the corresponding request LDAPMessage.
301 The message ID of a request MUST have a non-zero value different from
302 the values of any other requests outstanding in the LDAP association
303 of which this message is a part. The zero value is reserved for the
304 unsolicited notification message.
306 Typical clients increment a counter for each request.
308 A client MUST NOT send a request with the same message ID as an
309 earlier request on the same LDAP association unless it can be
310 determined that the server is no longer servicing the earlier request
311 (e.g. after the final response is received, or a subsequent bind
312 completes). Otherwise the behavior is undefined. For this purpose,
313 note that abandon and abandoned operations do not send responses.
318 The LDAPString is a notational convenience to indicate that, although
319 strings of LDAPString type encode as ASN.1 OCTET STRING types, the
320 [ISO10646] character set (a superset of [Unicode]) is used, encoded
321 following the [UTF-8] algorithm. Note that Unicode characters U+0000
322 through U+007F are the same as ASCII 0 through 127, respectively, and
323 have the same single octet UTF-8 encoding. Other Unicode characters
324 have a multiple octet UTF-8 encoding.
326 LDAPString ::= OCTET STRING -- UTF-8 encoded,
327 -- [ISO10646] characters
329 The LDAPOID is a notational convenience to indicate that the
330 permitted value of this string is a (UTF-8 encoded) dotted-decimal
331 representation of an OBJECT IDENTIFIER. Although an LDAPOID is
332 encoded as an OCTET STRING, values are limited to the definition of
333 <numericoid> given in Section 1.4 of [Models].
335 LDAPOID ::= OCTET STRING -- Constrained to <numericoid> [Models]
339 1.3.6.1.4.1.1466.1.2.3
342 4.1.3. Distinguished Name and Relative Distinguished Name
344 An LDAPDN is defined to be the representation of a Distinguished Name
345 (DN) after encoding according to the specification in [LDAPDN].
347 Sermersheim Internet-Draft - Expires Aug 2004 Page 6
\f
348 Lightweight Directory Access Protocol Version 3
351 LDAPDN ::= LDAPString
352 -- Constrained to <distinguishedName> [LDAPDN]
354 A RelativeLDAPDN is defined to be the representation of a Relative
355 Distinguished Name (RDN) after encoding according to the
356 specification in [LDAPDN].
358 RelativeLDAPDN ::= LDAPString
359 -- Constrained to <name-component> [LDAPDN]
362 4.1.4. Attribute Descriptions
364 The definition and encoding rules for attribute descriptions are
365 defined in Section 2.5 of [Models]. Briefly, an attribute description
366 is an attribute type and zero or more options.
368 AttributeDescription ::= LDAPString
369 -- Constrained to <attributedescription>
373 4.1.5. Attribute Value
375 A field of type AttributeValue is an OCTET STRING containing an
376 encoded attribute value. The attribute value is encoded according to
377 the LDAP-specific encoding definition of its corresponding syntax.
378 The LDAP-specific encoding definitions for different syntaxes and
379 attribute types may be found in other documents and in particular
382 AttributeValue ::= OCTET STRING
384 Note that there is no defined limit on the size of this encoding;
385 thus protocol values may include multi-megabyte attribute values
388 Attribute values may be defined which have arbitrary and non-
389 printable syntax. Implementations MUST NOT display nor attempt to
390 decode an attribute value if its syntax is not known. The
391 implementation may attempt to discover the subschema of the source
392 entry, and retrieve the descriptions of 'attributeTypes' from it
395 Clients MUST only send attribute values in a request that are valid
396 according to the syntax defined for the attributes.
399 4.1.6. Attribute Value Assertion
401 The AttributeValueAssertion (AVA) type definition is similar to the
402 one in the X.500 Directory standards. It contains an attribute
403 description and a matching rule ([Models Section 4.1.3) assertion
405 Sermersheim Internet-Draft - Expires Aug 2004 Page 7
\f
406 Lightweight Directory Access Protocol Version 3
408 value suitable for that type. Elements of this type are typically
409 used to assert that the value in assertionValue matches a value of an
412 AttributeValueAssertion ::= SEQUENCE {
413 attributeDesc AttributeDescription,
414 assertionValue AssertionValue }
416 AssertionValue ::= OCTET STRING
418 The syntax of the AssertionValue depends on the context of the LDAP
419 operation being performed. For example, the syntax of the EQUALITY
420 matching rule for an attribute is used when performing a Compare
421 operation. Often this is the same syntax used for values of the
422 attribute type, but in some cases the assertion syntax differs from
423 the value syntax. See objectIdentiferFirstComponentMatch in
424 [Syntaxes] for an example.
427 4.1.7. Attribute and PartialAttribute
429 Attributes and partial attributes consist of an attribute description
430 and attribute values. A PartialAttribute allows zero values, while
431 Attribute requires at least one value.
433 PartialAttribute ::= SEQUENCE {
434 type AttributeDescription,
435 vals SET OF value AttributeValue }
437 Attribute ::= PartialAttribute(WITH COMPONENTS {
439 vals (SIZE(1..MAX))})
441 No two attribute values are equivalent as described by Section 2.3 of
442 [Models]. The set of attribute values is unordered. Implementations
443 MUST NOT rely upon the ordering being repeatable.
446 4.1.8. Matching Rule Identifier
448 Matching rules are defined in Section 4.1.3 of [Models]. A matching
449 rule is identified in the protocol by the printable representation of
450 either its <numericoid>, or one of its short name descriptors
451 [Models], e.g. 'caseIgnoreMatch' or '2.5.13.2'.
453 MatchingRuleId ::= LDAPString
456 4.1.9. Result Message
458 The LDAPResult is the construct used in this protocol to return
459 success or failure indications from servers to clients. To various
460 requests, servers will return responses of LDAPResult or responses
463 Sermersheim Internet-Draft - Expires Aug 2004 Page 8
\f
464 Lightweight Directory Access Protocol Version 3
466 containing the components of LDAPResult to indicate the final status
467 of a protocol operation request.
469 LDAPResult ::= SEQUENCE {
470 resultCode ENUMERATED {
474 timeLimitExceeded (3),
475 sizeLimitExceeded (4),
478 authMethodNotSupported (7),
479 strongAuthRequired (8),
482 adminLimitExceeded (11),
483 unavailableCriticalExtension (12),
484 confidentialityRequired (13),
485 saslBindInProgress (14),
486 noSuchAttribute (16),
487 undefinedAttributeType (17),
488 inappropriateMatching (18),
489 constraintViolation (19),
490 attributeOrValueExists (20),
491 invalidAttributeSyntax (21),
495 invalidDNSyntax (34),
496 -- 35 reserved for undefined isLeaf --
497 aliasDereferencingProblem (36),
499 inappropriateAuthentication (48),
500 invalidCredentials (49),
501 insufficientAccessRights (50),
504 unwillingToPerform (53),
507 namingViolation (64),
508 objectClassViolation (65),
509 notAllowedOnNonLeaf (66),
510 notAllowedOnRDN (67),
511 entryAlreadyExists (68),
512 objectClassModsProhibited (69),
513 -- 70 reserved for CLDAP --
514 affectsMultipleDSAs (71),
519 diagnosticMessage LDAPString,
521 Sermersheim Internet-Draft - Expires Aug 2004 Page 9
\f
522 Lightweight Directory Access Protocol Version 3
524 referral [3] Referral OPTIONAL }
526 The resultCode enumeration is extensible as defined in Section 3.6 of
527 [LDAPIANA]. The meanings of the listed result codes are given in
528 Appendix A. If a server detects multiple errors for an operation,
529 only one result code is returned. The server should return the result
530 code that best indicates the nature of the error encountered.
532 The diagnosticMessage field of this construct may, at the server's
533 option, be used to return a string containing a textual, human-
534 readable (terminal control and page formatting characters should be
535 avoided) diagnostic message. As this diagnostic message is not
536 standardized, implementations MUST NOT rely on the values returned.
537 If the server chooses not to return a textual diagnostic, the
538 diagnosticMessage field MUST be empty.
540 For certain result codes (typically, but not restricted to
541 noSuchObject, aliasProblem, invalidDNSyntax and
542 aliasDereferencingProblem), the matchedDN field is set to the name of
543 the lowest entry (object or alias) in the Directory that was matched.
544 If no aliases were dereferenced while attempting to locate the entry,
545 this will be a truncated form of the name provided, or if aliases
546 were dereferenced, of the resulting name, as defined in Section 12.5
547 of [X.511]. Otherwise the matchedDN field is empty.
552 The referral result code indicates that the contacted server does not
553 hold the target entry of the request. The referral field is present
554 in an LDAPResult if the resultCode field value is referral, and
555 absent with all other result codes. It contains one or more
556 references to one or more servers or services that may be accessed
557 via LDAP or other protocols. Referrals can be returned in response to
558 any operation request (except unbind and abandon which do not have
559 responses). At least one URI MUST be present in the Referral.
561 During a search operation, after the baseObject is located, and
562 entries are being evaluated, the referral is not returned. Instead,
563 continuation references, described in Section 4.5.3, are returned
564 when other servers would need to be contacted to complete the
567 Referral ::= SEQUENCE SIZE (1..MAX) OF uri URI
569 URI ::= LDAPString -- limited to characters permitted in
572 If the client wishes to progress the operation, it MUST follow the
573 referral by contacting one of the supported services. If multiple
574 URIs are present, the client assumes that any supported URI may be
575 used to progress the operation.
579 Sermersheim Internet-Draft - Expires Aug 2004 Page 10
\f
580 Lightweight Directory Access Protocol Version 3
582 Protocol peers that follow referrals MUST ensure that they do not
583 loop between servers. They MUST NOT repeatedly contact the same
584 server for the same request with the same target entry name, scope
585 and filter. Some implementations use a counter that is incremented
586 each time referral handling occurs for an operation, and these kinds
587 of implementations MUST be able to handle at least ten nested
588 referrals between the root and a leaf entry.
590 A URI for a server implementing LDAP and accessible via [TCP]/[IP]
591 (v4 or v6) is written as an LDAP URL according to [LDAPURL].
593 When an LDAP URL is used, the following instructions are followed:
595 - If an alias was dereferenced, the <dn> part of the URL MUST be
596 present, with the new target object name. UTF-8 encoded characters
597 appearing in the string representation of a DN or search filter
598 may not be legal for URLs (e.g. spaces) and MUST be escaped using
599 the % method in [URI].
600 - It is RECOMMENDED that the <dn> part be present to avoid
602 - If the <dn> part is present, the client MUST use this name in its
603 next request to progress the operation, and if it is not present
604 the client will use the same name as in the original request.
605 - Some servers (e.g. participating in distributed indexing) may
606 provide a different filter in a URL of a referral for a search
608 - If the <filter> part of the LDAP URL is present, the client MUST
609 use this filter in its next request to progress this search, and
610 if it is not present the client MUST use the same filter as it
611 used for that search.
612 - For search, it is RECOMMENDED that the <scope> part be present to
614 - If the <scope> part is missing, the scope of the original search
615 is used by the client to progress the operation.
616 - Other aspects of the new request may be the same as or different
617 from the request which generated the referral.
619 Other kinds of URIs may be returned. The syntax and semantics of such
620 URIs is left to future specifications. Clients may ignore URIs that
626 Controls provide a mechanism whereby the semantics and arguments of
627 existing LDAP operations may be extended. One or more controls may be
628 attached to a single LDAP message. A control only affects the
629 semantics of the message it is attached to.
631 Controls sent by clients are termed 'request controls' and those sent
632 by servers are termed 'response controls'.
633 When an extension calls for a particular response control to be sent
634 in response to a request control, the response and request controls
635 are termed to be "paired".
637 Sermersheim Internet-Draft - Expires Aug 2004 Page 11
\f
638 Lightweight Directory Access Protocol Version 3
641 Controls ::= SEQUENCE OF control Control
643 Control ::= SEQUENCE {
645 criticality BOOLEAN DEFAULT FALSE,
646 controlValue OCTET STRING OPTIONAL }
648 The controlType field is the dotted-decimal representation of an
649 OBJECT IDENTIFIER which uniquely identifies the control, or the
650 request control and its paired response control. This provides
651 unambiguous naming of controls.
653 The criticality field only has meaning in controls attached to
654 request messages (except unbindRequest). For controls attached to
655 response messages and the unbindRequest, the criticality field SHOULD
656 be FALSE, and MUST be ignored by the receiving protocol peer. A value
657 of TRUE indicates that it is unacceptable to perform the operation
658 without applying the semantics of the control and FALSE otherwise.
659 Specifically, the criticality field is applied as follows:
661 - Regardless of the value of the criticality field, if the server
662 recognizes the control type and it is appropriate for the
663 operation, the server is to make use of the control when
664 performing the operation.
666 - If the server does not recognize the control type or it is not
667 appropriate for the operation, and the criticality field is TRUE,
668 the server MUST NOT perform the operation, and for operations that
669 have a response message, MUST return unavailableCriticalExtension
672 - If the server does not recognize the control type or it is not
673 appropriate for the operation, and the criticality field is FALSE,
674 the server MUST ignore the control.
676 The controlValue may contain information associated with the
677 controlType. Its format is defined by the specification of the
678 control. Implementations MUST be prepared to handle arbitrary
679 contents of the controlValue octet string, including zero bytes. It
680 is absent only if there is no value information which is associated
681 with a control of its type. When a controlValue is defined in terms
682 of ASN.1, and BER encoded according to Section 5.1, it also follows
683 the extensibility rules in Section 4.
685 Servers list the controlType of all request controls they recognize
686 in the supportedControl attribute in the root DSE (Section 5.1 of
689 Controls SHOULD NOT be combined unless the semantics of the
690 combination has been specified. The semantics of control
691 combinations, if specified, are generally found in the control
692 specification most recently published. In the absence of combination
693 semantics, the behavior of the operation is undefined.
695 Sermersheim Internet-Draft - Expires Aug 2004 Page 12
\f
696 Lightweight Directory Access Protocol Version 3
698 Additionally, unless order-dependent semantics are given in a
699 specification, the order of a combination of controls in the SEQUENCE
702 This document does not specify any controls. Controls may be
703 specified in other documents. Documents detailing control extensions
704 are to provide for each control:
706 - the OBJECT IDENTIFIER assigned to the control,
708 - direction as to what value the sender should provide for the
709 criticality field (note: the semantics of the criticality field
710 are defined above should not be altered by the control's
713 - whether information is to be present in the controlValue field,
714 and if so, the format of the controlValue contents,
716 - the semantics of the control, and
718 - optionally, semantics regarding the combination of the control
724 The function of the Bind Operation is to allow authentication
725 information to be exchanged between the client and server. The Bind
726 operation should be thought of as the "authenticate" operation.
727 Authentication and security-related semantics of this operation are
730 The Bind Request is defined as follows:
732 BindRequest ::= [APPLICATION 0] SEQUENCE {
733 version INTEGER (1 .. 127),
735 authentication AuthenticationChoice }
737 AuthenticationChoice ::= CHOICE {
738 simple [0] OCTET STRING,
740 sasl [3] SaslCredentials,
743 SaslCredentials ::= SEQUENCE {
744 mechanism LDAPString,
745 credentials OCTET STRING OPTIONAL }
747 Fields of the Bind Request are:
749 - version: A version number indicating the version of the protocol
750 to be used in this LDAP association. This document describes
751 version 3 of the protocol. There is no version negotiation. The
753 Sermersheim Internet-Draft - Expires Aug 2004 Page 13
\f
754 Lightweight Directory Access Protocol Version 3
756 client sets this field to the version it desires. If the server
757 does not support the specified version, it MUST respond with
758 protocolError in the resultCode field of the BindResponse.
760 - name: The name of the Directory object that the client wishes to
761 bind as. This field may take on a null value (a zero length
762 string) for the purposes of anonymous binds ([AuthMeth] Section
763 5.1) or when using Simple Authentication and Security Layer [SASL]
764 authentication ([AuthMeth] Section 3.3.2). Server behavior is
765 undefined when the name is a null value, simple authentication is
766 used, and a non-null password is specified. Where the server
767 attempts to locate the named object, it SHALL NOT perform alias
770 - authentication: information used in authentication. This type is
771 extensible as defined in Section 3.7 of [LDAPIANA]. Servers that
772 do not support a choice supplied by a client return
773 authMethodNotSupported in the resultCode field of the
776 Textual passwords (consisting of a character sequence with a known
777 character set and encoding) transferred to the server using the
778 simple AuthenticationChoice SHALL be transferred as [UTF-8]
779 encoded [Unicode]. Prior to transfer, clients SHOULD prepare text
780 passwords by applying the [SASLprep] profile of the [Stringprep]
781 algorithm. Passwords consisting of other data (such as random
782 octets) MUST NOT be altered. The determination of whether a
783 password is textual is a local client matter.
785 Authorization is the use of this authentication information when
786 performing operations. Authorization MAY be affected by factors
787 outside of the LDAP Bind Request, such as those provided by lower
788 layer security services.
791 4.2.1. Processing of the Bind Request
793 Before processing a BindRequest, all outstanding operations MUST
794 either complete or be abandoned. The server may either wait for the
795 outstanding operations to complete, or abandon them. The server then
796 proceeds to authenticate the client in either a single-step, or
797 multi-step bind process. Each step requires the server to return a
798 BindResponse to indicate the status of authentication.
800 If the client did not bind before sending a request and receives an
801 operationsError to that request, it may then send a Bind Request. If
802 this also fails or the client chooses not to bind on the existing
803 connection, it may close the connection, reopen it and begin again by
804 first sending a PDU with a Bind Request. This will aid in
805 interoperating with servers implementing other versions of LDAP.
807 Clients may send multiple Bind Requests on a connection to change the
808 authentication and/or security associations or to complete a multi-
811 Sermersheim Internet-Draft - Expires Aug 2004 Page 14
\f
812 Lightweight Directory Access Protocol Version 3
814 stage bind process. Authentication from earlier binds is subsequently
817 For some SASL authentication mechanisms, it may be necessary for the
818 client to invoke the BindRequest multiple times. This is indicated by
819 the server sending a BindResponse with the resultCode set to
820 saslBindInProgress. This indicates that the server requires the
821 client to send a new bind request, with the same sasl mechanism, to
822 continue the authentication process. Clients MUST NOT invoke
823 operations between two Bind Requests made as part of a multi-stage
826 A client may abort a SASL bind negotiation by sending a BindRequest
827 with a different value in the mechanism field of SaslCredentials, or
828 an AuthenticationChoice other than sasl.
830 If the client sends a BindRequest with the sasl mechanism field as an
831 empty string, the server MUST return a BindResponse with
832 authMethodNotSupported as the resultCode. This will allow clients to
833 abort a negotiation if it wishes to try again with the same SASL
836 A failed Bind Operation has the effect of placing the connection in
842 The Bind Response is defined as follows.
844 BindResponse ::= [APPLICATION 1] SEQUENCE {
845 COMPONENTS OF LDAPResult,
846 serverSaslCreds [7] OCTET STRING OPTIONAL }
848 BindResponse consists simply of an indication from the server of the
849 status of the client's request for authentication.
851 A successful bind operation is indicated by a BindResponse with a
852 resultCode set to success. Otherwise, an appropriate result code is
853 set in the BindResponse. For bind, the protocolError result code may
854 be used to indicate that the version number supplied by the client is
857 If the client receives a BindResponse where the resultCode field is
858 protocolError, it is to assume that the server does not support this
859 version of LDAP. While the client may be able proceed with another
860 version of this protocol (this may or may not require establishing a
861 new connection), how to proceed with another version of this protocol
862 is beyond the scope of this document. Clients which are unable or
863 unwilling to proceed SHOULD drop the underlying connection.
865 The serverSaslCreds field is used as part of a SASL-defined bind
866 mechanism to allow the client to authenticate the server to which it
867 is communicating, or to perform "challenge-response" authentication.
869 Sermersheim Internet-Draft - Expires Aug 2004 Page 15
\f
870 Lightweight Directory Access Protocol Version 3
872 If the client bound with the simple choice, or the SASL mechanism
873 does not require the server to return information to the client, then
874 this field SHALL NOT be included in the BindResponse.
877 4.3. Unbind Operation
879 The function of the Unbind Operation is to terminate an LDAP
880 association and connection. The Unbind operation is not the
881 antithesis of the Bind operation as the name implies. The naming of
882 these operations is historical. The Unbind operation should be
883 thought of as the "quit" operation.
885 The Unbind Operation is defined as follows:
887 UnbindRequest ::= [APPLICATION 2] NULL
889 The Unbind Operation has no response defined. Upon transmission of
890 the UnbindRequest, each protocol peer is to consider the LDAP
891 association terminated, MUST cease transmission of messages to the
892 other peer, and MUST close the connection. Outstanding operations are
893 handled as specified in Section 5.2.
896 4.4. Unsolicited Notification
898 An unsolicited notification is an LDAPMessage sent from the server to
899 the client which is not in response to any LDAPMessage received by
900 the server. It is used to signal an extraordinary condition in the
901 server or in the connection between the client and the server. The
902 notification is of an advisory nature, and the server will not expect
903 any response to be returned from the client.
905 The unsolicited notification is structured as an LDAPMessage in which
906 the messageID is zero and protocolOp is of the extendedResp form (See
907 Section 4.12). The responseName field of the ExtendedResponse always
908 contains an LDAPOID which is unique for this notification.
910 One unsolicited notification (Notice of Disconnection) is defined in
911 this document. The specification of an unsolicited notification
914 - the OBJECT IDENTIFIER assigned to the notification (to be
915 specified in the responseName,
917 - the format of the contents (if any) of the responseValue,
919 - the circumstances which will cause the notification to be
922 - the semantics of the operation.
925 4.4.1. Notice of Disconnection
927 Sermersheim Internet-Draft - Expires Aug 2004 Page 16
\f
928 Lightweight Directory Access Protocol Version 3
931 This notification may be used by the server to advise the client that
932 the server is about to close the connection due to an error
933 condition. This notification is intended to assist clients in
934 distinguishing between an error condition and a transient network
935 failure. Note that this notification is not a response to an unbind
936 requested by the client. Outstanding operations are handled as
937 specified in Section 5.2.
939 The responseName is 1.3.6.1.4.1.1466.20036, the response field is
940 absent, and the resultCode is used to indicate the reason for the
943 The following result codes have these meanings when used in this
946 - protocolError: The server has received data from the client in
947 which the LDAPMessage structure could not be parsed.
949 - strongAuthRequired: The server has detected that an established
950 security association between the client and server has
951 unexpectedly failed or been compromised, or that the server now
952 requires the client to authenticate using a strong(er) mechanism.
954 - unavailable: This server will stop accepting new connections and
955 operations on all existing connections, and be unavailable for an
956 extended period of time. The client may make use of an alternative
959 Upon transmission of the Notice of Disconnection, the server is to
960 consider the LDAP association terminated, MUST cease transmission of
961 messages to the client, and MUST close the connection.
964 4.5. Search Operation
966 The Search Operation is used to request a server to return, subject
967 to access controls and other restrictions, a set of entries matching
968 a complex search criterion. This can be used to read attributes from
969 a single entry, from entries immediately subordinate to a particular
970 entry, or a whole subtree of entries.
973 4.5.1. Search Request
975 The Search Request is defined as follows:
977 SearchRequest ::= [APPLICATION 3] SEQUENCE {
983 derefAliases ENUMERATED {
985 Sermersheim Internet-Draft - Expires Aug 2004 Page 17
\f
986 Lightweight Directory Access Protocol Version 3
988 neverDerefAliases (0),
989 derefInSearching (1),
990 derefFindingBaseObj (2),
992 sizeLimit INTEGER (0 .. maxInt),
993 timeLimit INTEGER (0 .. maxInt),
996 attributes AttributeSelection }
998 AttributeSelection ::= SEQUENCE OF selection LDAPString
999 -- constrained to <attributeSelection> below
1002 and [0] SET SIZE (1..MAX) OF filter Filter,
1003 or [1] SET SIZE (1..MAX) OF filter Filter,
1005 equalityMatch [3] AttributeValueAssertion,
1006 substrings [4] SubstringFilter,
1007 greaterOrEqual [5] AttributeValueAssertion,
1008 lessOrEqual [6] AttributeValueAssertion,
1009 present [7] AttributeDescription,
1010 approxMatch [8] AttributeValueAssertion,
1011 extensibleMatch [9] MatchingRuleAssertion }
1013 SubstringFilter ::= SEQUENCE {
1014 type AttributeDescription,
1015 -- initial and final can occur at most once
1016 substrings SEQUENCE SIZE (1..MAX) OF substring CHOICE {
1017 initial [0] AssertionValue,
1018 any [1] AssertionValue,
1019 final [2] AssertionValue } }
1021 MatchingRuleAssertion ::= SEQUENCE {
1022 matchingRule [1] MatchingRuleId OPTIONAL,
1023 type [2] AttributeDescription OPTIONAL,
1024 matchValue [3] AssertionValue,
1025 dnAttributes [4] BOOLEAN DEFAULT FALSE }
1027 Fields of the Search Request are:
1029 - baseObject: The name of the base object entry relative to which
1030 the search is to be performed.
1032 - scope: Specifies the scope of the search to be performed. The
1033 semantics (as described in [X.511]) of the possible values of this
1036 baseObject: The scope is constrained to the entry named by
1039 singleLevel: The scope is constrained to the immediate
1040 subordinates of the entry named by baseObject.
1043 Sermersheim Internet-Draft - Expires Aug 2004 Page 18
\f
1044 Lightweight Directory Access Protocol Version 3
1046 wholeSubtree: the scope is constrained to the entry named by
1047 the baseObject, and all its subordinates.
1050 - derefAliases: An indicator as to how alias entries (as defined in
1051 [Models]) are to be handled in searching. The semantics of the
1052 possible values of this field are:
1054 neverDerefAliases: Do not dereference aliases in searching or
1055 in locating the base object of the search.
1057 derefInSearching: While searching, dereference any alias entry
1058 subordinate to the base object which is also in the search
1059 scope. The filter is applied to the dereferenced object(s). If
1060 the search scope is wholeSubtree, the search continues in the
1061 subtree of any dereferenced object. Aliases in that subtree are
1062 also dereferenced. Servers SHOULD eliminate duplicate entries
1063 that arise due to alias dereferencing while searching.
1065 derefFindingBaseObj: Dereference aliases in locating the base
1066 object of the search, but not when searching subordinates of
1069 derefAlways: Dereference aliases both in searching and in
1070 locating the base object of the search.
1071 Servers MUST detect looping while dereferencing aliases in order
1072 to prevent denial of service attacks of this nature.
1074 - sizeLimit: A size limit that restricts the maximum number of
1075 entries to be returned as a result of the search. A value of zero
1076 in this field indicates that no client-requested size limit
1077 restrictions are in effect for the search. Servers may also
1078 enforce a maximum number of entries to return.
1080 - timeLimit: A time limit that restricts the maximum time (in
1081 seconds) allowed for a search. A value of zero in this field
1082 indicates that no client-requested time limit restrictions are in
1083 effect for the search. Servers may also enforce a maximum time
1084 limit for the search.
1086 - typesOnly: An indicator as to whether search results are to
1087 contain both attribute descriptions and values, or just attribute
1088 descriptions. Setting this field to TRUE causes only attribute
1089 descriptions (no values) to be returned. Setting this field to
1090 FALSE causes both attribute descriptions and values to be
1093 - filter: A filter that defines the conditions that must be
1094 fulfilled in order for the search to match a given entry.
1096 The 'and', 'or' and 'not' choices can be used to form combinations
1097 of filters. At least one filter element MUST be present in an
1098 'and' or 'or' choice. The others match against individual
1099 attribute values of entries in the scope of the search.
1101 Sermersheim Internet-Draft - Expires Aug 2004 Page 19
\f
1102 Lightweight Directory Access Protocol Version 3
1104 (Implementor's note: the 'not' filter is an example of a tagged
1105 choice in an implicitly-tagged module. In BER this is treated as
1106 if the tag was explicit.)
1108 A server MUST evaluate filters according to the three-valued logic
1109 of X.511 (1993) Section 7.8.1. In summary, a filter is evaluated
1110 to either "TRUE", "FALSE" or "Undefined". If the filter evaluates
1111 to TRUE for a particular entry, then the attributes of that entry
1112 are returned as part of the search result (subject to any
1113 applicable access control restrictions). If the filter evaluates
1114 to FALSE or Undefined, then the entry is ignored for the search.
1116 A filter of the "and" choice is TRUE if all the filters in the SET
1117 OF evaluate to TRUE, FALSE if at least one filter is FALSE, and
1118 otherwise Undefined. A filter of the "or" choice is FALSE if all
1119 of the filters in the SET OF evaluate to FALSE, TRUE if at least
1120 one filter is TRUE, and Undefined otherwise. A filter of the 'not'
1121 choice is TRUE if the filter being negated is FALSE, FALSE if it
1122 is TRUE, and Undefined if it is Undefined.
1124 The present match evaluates to TRUE where there is an attribute or
1125 subtype of the specified attribute description present in an
1126 entry, and FALSE otherwise (including a presence test with an
1127 unrecognized attribute description.)
1129 The matching rule for equalityMatch filter items is defined by the
1130 EQUALITY matching rule for the attribute type.
1132 There SHALL be at most one 'initial', and at most one 'final' in
1133 the 'substrings' of a SubstringFilter. If 'initial' is present, it
1134 SHALL be the first element of 'substrings'. If 'final' is present,
1135 it SHALL be the last element of 'substrings'.
1136 The matching rule for AssertionValues in a substrings filter item
1137 is defined by the SUBSTR matching rule for the attribute type.
1138 Note that the AssertionValue in a substrings filter item conforms
1139 to the assertion syntax of the EQUALITY matching rule for the
1140 attribute type rather than the assertion syntax of the SUBSTR
1141 matching rule for the attribute type. Conceptually, the entire
1142 SubstringFilter is converted into an assertion value of the
1143 substrings matching rule prior to applying the rule.
1145 The matching rule for the greaterOrEqual filter item is defined by
1146 the ORDERING and EQUALITY matching rules for the attribute type.
1148 The matching rule for the lessOrEqual filter item is defined by
1149 the ORDERING matching rule for the attribute type.
1151 An approxMatch filter item evaluates to TRUE when there is a value
1152 of the attribute or subtype for which some locally-defined
1153 approximate matching algorithm (e.g. spelling variations, phonetic
1154 match, etc.) returns TRUE. If an item matches for equality, it
1155 also satisfies an approximate match. If approximate matching is
1156 not supported, this filter item should be treated as an
1159 Sermersheim Internet-Draft - Expires Aug 2004 Page 20
\f
1160 Lightweight Directory Access Protocol Version 3
1163 An extensibleMatch filter item is evaluated as follows:
1165 If the matchingRule field is absent, the type field MUST be
1166 present, and an equality match is performed for that type.
1168 If the type field is absent and the matchingRule is present, the
1169 matchValue is compared against all attributes in an entry which
1170 support that matchingRule. The matchingRule determines the
1171 syntax for the assertion value. The filter item evaluates to
1172 TRUE if it matches with at least one attribute in the entry,
1173 FALSE if it does not match any attribute in the entry, and
1174 Undefined if the matchingRule is not recognized or the
1175 assertionValue is invalid.
1177 If the type field is present and the matchingRule is present,
1178 the matchValue is compared against entry attributes of the
1179 specified type. In this case, the matchingRule MUST be one
1180 suitable for use with the specified type (see [Syntaxes]),
1181 otherwise the filter item is Undefined.
1183 If the dnAttributes field is set to TRUE, the match is
1184 additionally applied against all the AttributeValueAssertions in
1185 an entry's distinguished name, and evaluates to TRUE if there is
1186 at least one attribute in the distinguished name for which the
1187 filter item evaluates to TRUE. The dnAttributes field is present
1188 to alleviate the need for multiple versions of generic matching
1189 rules (such as word matching), where one applies to entries and
1190 another applies to entries and dn attributes as well.
1192 A filter item evaluates to Undefined when the server would not be
1193 able to determine whether the assertion value matches an entry. If
1194 an attribute description in an equalityMatch, substrings,
1195 greaterOrEqual, lessOrEqual, approxMatch or extensibleMatch filter
1196 is not recognized by the server, a matching rule id in the
1197 extensibleMatch is not recognized by the server, the assertion
1198 value is invalid, or the type of filtering requested is not
1199 implemented, then the filter is Undefined. Thus for example if a
1200 server did not recognize the attribute type shoeSize, a filter of
1201 (shoeSize=*) would evaluate to FALSE, and the filters
1202 (shoeSize=12), (shoeSize>=12) and (shoeSize<=12) would evaluate to
1205 Servers MUST NOT return errors if attribute descriptions or
1206 matching rule ids are not recognized, assertion values are
1207 invalid, or the assertion syntax is not supported. More details of
1208 filter processing are given in Section 7.8 of [X.511].
1210 - attributes: A list of the attributes to be returned from each
1211 entry which matches the search filter. LDAPString values of this
1212 field are constrained to the following Augmented Backus-Naur Form
1215 attributeSelection = attributedescription / selectionspecial
1217 Sermersheim Internet-Draft - Expires Aug 2004 Page 21
\f
1218 Lightweight Directory Access Protocol Version 3
1221 selectionspecial = noattrs / alluserattrs
1223 noattrs = %x31.2E.31 ; "1.1"
1225 alluserattrs = %x2A ; asterisk ("*")
1227 The <attributedescription> production is defined in Section 2.5 of
1230 There are three special cases which may exist in the attribute
1232 - an empty list with no attributes,
1233 - a list containing "*" (with zero or more attribute
1235 - a list containing only "1.1".
1237 An empty list requests the return of all user attributes.
1239 A list containing "*" requests all user attributes in addition to
1240 other listed (operational) attributes.
1242 A list containing only the OID "1.1" indicates that no values are
1243 to be returned. If "1.1" is provided with other values, the "1.1"
1244 value is ignored. This OID was chosen because it does not (and can
1245 not) correspond to any attribute in use.
1247 Client implementors should note that even if all user attributes
1248 are requested, some attributes and/or attribute values of the
1249 entry may not be included in search results due to access controls
1250 or other restrictions. Furthermore, servers will not return
1251 operational attributes, such as objectClasses or attributeTypes,
1252 unless they are listed by name. Operational attributes are
1253 described in [Models].
1255 Attributes are returned at most once in an entry. If an attribute
1256 description is named more than once in the list, the subsequent
1257 names are ignored. If an attribute description in the list is not
1258 recognized, it is ignored by the server.
1260 Note that an X.500 "list"-like operation can be emulated by the
1261 client requesting a one-level LDAP search operation with a filter
1262 checking for the presence of the 'objectClass' attribute, and that an
1263 X.500 "read"-like operation can be emulated by a base object LDAP
1264 search operation with the same filter. A server which provides a
1265 gateway to X.500 is not required to use the Read or List operations,
1266 although it may choose to do so, and if it does, it must provide the
1267 same semantics as the X.500 search operation.
1270 4.5.2. Search Result
1275 Sermersheim Internet-Draft - Expires Aug 2004 Page 22
\f
1276 Lightweight Directory Access Protocol Version 3
1278 The results of the search operation are returned as zero or more
1279 searchResultEntry messages, zero or more SearchResultReference
1280 messages, followed by a single searchResultDone message.
1282 SearchResultEntry ::= [APPLICATION 4] SEQUENCE {
1284 attributes PartialAttributeList }
1286 PartialAttributeList ::= SEQUENCE OF
1287 partialAttribute PartialAttribute
1288 -- Note that the PartialAttributeList may hold zero elements.
1289 -- This may happen when none of the attributes of an entry
1290 -- were requested, or could be returned.
1291 -- Note also that the partialAttribute vals set may hold zero
1292 -- elements. This may happen when typesOnly is requested, access
1293 -- controls prevent the return of values, or other reasons.
1295 SearchResultReference ::= [APPLICATION 19] SEQUENCE
1296 SIZE (1..MAX) OF uri URI
1298 SearchResultDone ::= [APPLICATION 5] LDAPResult
1300 Each SearchResultEntry represents an entry found during the search.
1301 Each SearchResultReference represents an area not yet explored during
1302 the search. The SearchResultEntry and SearchResultReference PDUs may
1303 come in any order. Following all the SearchResultReference and
1304 SearchResultEntry responses, the server returns a SearchResultDone
1305 response, which contains an indication of success, or detailing any
1306 errors that have occurred.
1308 Each entry returned in a SearchResultEntry will contain all
1309 appropriate attributes as specified in the attributes field of the
1310 Search Request. Return of attributes is subject to access control and
1311 other administrative policy.
1313 Some attributes may be constructed by the server and appear in a
1314 SearchResultEntry attribute list, although they are not stored
1315 attributes of an entry. Clients SHOULD NOT assume that all attributes
1316 can be modified, even if permitted by access control.
1318 If the server's schema defines short names [Models] for an attribute
1319 type then the server SHOULD use one of those names in attribute
1320 descriptions for that attribute type (in preference to using the
1321 <numericoid> [Models] format of the attribute type's object
1322 identifier). The server SHOULD NOT use the short name if that name is
1323 known by the server to be ambiguous, or otherwise likely to cause
1324 interoperability problems.
1327 4.5.3. Continuation References in the Search Result
1329 If the server was able to locate the entry referred to by the
1330 baseObject but was unable to search one or more non-local entries,
1331 the server may return one or more SearchResultReference entries, each
1333 Sermersheim Internet-Draft - Expires Aug 2004 Page 23
\f
1334 Lightweight Directory Access Protocol Version 3
1336 containing a reference to another set of servers for continuing the
1337 operation. A server MUST NOT return any SearchResultReference if it
1338 has not located the baseObject and thus has not searched any entries;
1339 in this case it would return a SearchResultDone containing a referral
1342 If a server holds a copy or partial copy of the subordinate naming
1343 context [Section 5 of Models], it may use the search filter to
1344 determine whether or not to return a SearchResultReference response.
1345 Otherwise SearchResultReference responses are always returned when in
1348 The SearchResultReference is of the same data type as the Referral.
1350 A URI for a server implementing LDAP and accessible via [TCP]/[IP]
1351 (v4 or v6) is written as an LDAP URL according to [LDAPURL].
1353 In order to complete the search, the client issues a new search
1354 operation for each SearchResultReference that is returned. Note that
1355 the abandon operation described in Section 4.11 applies only to a
1356 particular operation sent on an association between a client and
1357 server. The client must abandon subsequent search operations it
1358 wishes to individually.
1360 Clients that follow search continuation references MUST ensure that
1361 they do not loop between servers. They MUST NOT repeatedly contact
1362 the same server for the same request with the same target entry name,
1363 scope and filter. Some clients use a counter that is incremented each
1364 time search result reference handling occurs for an operation, and
1365 these kinds of clients MUST be able to handle at least ten nested
1366 search result references between the root and a leaf entry.
1368 When an LDAP URL is used, the following instructions are followed:
1370 - The <dn> part of the URL MUST be present, with the new target
1371 object name. The client MUST use this name when following the
1372 reference. UTF-8 encoded characters appearing in the string
1373 representation of a DN or search filter may not be legal for URLs
1374 (e.g. spaces) and MUST be escaped using the % method in [URI].
1375 - Some servers (e.g. participating in distributed indexing) may
1376 provide a different filter in a URL of a SearchResultReference.
1377 - If the <filter> part of the URL is present, the client MUST use
1378 this filter in its next request to progress this search, and if it
1379 is not present the client MUST use the same filter as it used for
1381 - If the originating search scope was singleLevel, the <scope> part
1382 of the URL will be "base".
1383 - it is RECOMMENDED that the <scope> part be present to avoid
1385 - Other aspects of the new search request may be the same as or
1386 different from the search request which generated the
1387 SearchResultReference.
1388 - The name of an unexplored subtree in a SearchResultReference need
1389 not be subordinate to the base object.
1391 Sermersheim Internet-Draft - Expires Aug 2004 Page 24
\f
1392 Lightweight Directory Access Protocol Version 3
1395 Other kinds of URIs may be returned. The syntax and semantics of such
1396 URIs is left to future specifications. Clients may ignore URIs that
1397 they do not support.
1402 For example, suppose the contacted server (hosta) holds the entry
1403 <DC=Example,DC=NET> and the entry <CN=Manager,DC=Example,DC=NET>. It
1404 knows that either LDAP-capable servers (hostb) or (hostc) hold
1405 <OU=People,DC=Example,DC=NET> (one is the master and the other server
1406 a shadow), and that LDAP-capable server (hostd) holds the subtree
1407 <OU=Roles,DC=Example,DC=NET>. If a wholeSubtree search of
1408 <DC=Example,DC=NET> is requested to the contacted server, it may
1409 return the following:
1411 SearchResultEntry for DC=Example,DC=NET
1412 SearchResultEntry for CN=Manager,DC=Example,DC=NET
1413 SearchResultReference {
1414 ldap://hostb/OU=People,DC=Example,DC=NET??sub
1415 ldap://hostc/OU=People,DC=Example,DC=NET??sub }
1416 SearchResultReference {
1417 ldap://hostd/OU=Roles,DC=Example,DC=NET??sub }
1418 SearchResultDone (success)
1420 Client implementors should note that when following a
1421 SearchResultReference, additional SearchResultReference may be
1422 generated. Continuing the example, if the client contacted the server
1423 (hostb) and issued the search for the subtree
1424 <OU=People,DC=Example,DC=NET>, the server might respond as follows:
1426 SearchResultEntry for OU=People,DC=Example,DC=NET
1427 SearchResultReference {
1428 ldap://hoste/OU=Managers,OU=People,DC=Example,DC=NET??sub }
1429 SearchResultReference {
1430 ldap://hostf/OU=Consultants,OU=People,DC=Example,DC=NET??sub }
1431 SearchResultDone (success)
1433 Similarly, if a singleLevel search of <DC=Example,DC=NET> is
1434 requested to the contacted server, it may return the following:
1436 SearchResultEntry for CN=Manager,DC=Example,DC=NET
1437 SearchResultReference {
1438 ldap://hostb/OU=People,DC=Example,DC=NET??base
1439 ldap://hostc/OU=People,DC=Example,DC=NET??base }
1440 SearchResultReference {
1441 ldap://hostd/OU=Roles,DC=Example,DC=NET??base }
1442 SearchResultDone (success)
1444 If the contacted server does not hold the base object for the search,
1445 then it will return a referral to the client. For example, if the
1446 client requests a subtree search of <DC=Example,DC=ORG> to hosta, the
1447 server may return only a SearchResultDone containing a referral.
1449 Sermersheim Internet-Draft - Expires Aug 2004 Page 25
\f
1450 Lightweight Directory Access Protocol Version 3
1453 SearchResultDone (referral) {
1454 ldap://hostg/DC=Example,DC=ORG??sub }
1457 4.6. Modify Operation
1459 The Modify Operation allows a client to request that a modification
1460 of an entry be performed on its behalf by a server. The Modify
1461 Request is defined as follows:
1463 ModifyRequest ::= [APPLICATION 6] SEQUENCE {
1465 changes SEQUENCE OF change SEQUENCE {
1466 operation ENUMERATED {
1470 modification PartialAttribute } }
1472 Fields of the Modify Request are:
1474 - object: The name of the object to be modified. The value of this
1475 field contains the DN of the entry to be modified. The server
1476 SHALL NOT perform any alias dereferencing in determining the
1477 object to be modified.
1479 - changes: A list of modifications to be performed on the entry. The
1480 entire list of modifications MUST be performed in the order they
1481 are listed as a single atomic operation. While individual
1482 modifications may violate certain aspects of the directory schema
1483 (such as the object class definition and DIT content rule), the
1484 resulting entry after the entire list of modifications is
1485 performed MUST conform to the requirements of the directory schema
1488 - operation: Used to specify the type of modification being
1489 performed. Each operation type acts on the following
1490 modification. The values of this field have the following
1491 semantics respectively:
1493 add: add values listed to the modification attribute,
1494 creating the attribute if necessary;
1496 delete: delete values listed from the modification attribute,
1497 removing the entire attribute if no values are listed, or if
1498 all current values of the attribute are listed for deletion;
1500 replace: replace all existing values of the modification
1501 attribute with the new values listed, creating the attribute
1502 if it did not already exist. A replace with no value will
1503 delete the entire attribute if it exists, and is ignored if
1504 the attribute does not exist.
1507 Sermersheim Internet-Draft - Expires Aug 2004 Page 26
\f
1508 Lightweight Directory Access Protocol Version 3
1510 - modification: A PartialAttribute (which may have an empty SET
1511 of vals) used to hold the attribute type or attribute type and
1512 values being modified.
1514 Upon receipt of a Modify Request, the server attempts to perform the
1515 necessary modifications to the DIT and returns the result in a Modify
1516 Response, defined as follows:
1518 ModifyResponse ::= [APPLICATION 7] LDAPResult
1520 The server will return to the client a single Modify Response
1521 indicating either the successful completion of the DIT modification,
1522 or the reason that the modification failed. Due to the requirement
1523 for atomicity in applying the list of modifications in the Modify
1524 Request, the client may expect that no modifications of the DIT have
1525 been performed if the Modify Response received indicates any sort of
1526 error, and that all requested modifications have been performed if
1527 the Modify Response indicates successful completion of the Modify
1528 Operation. If the association changes or the connection fails,
1529 whether the modification occurred or not is indeterminate.
1531 The Modify Operation cannot be used to remove from an entry any of
1532 its distinguished values, i.e. those values which form the entry's
1533 relative distinguished name. An attempt to do so will result in the
1534 server returning the notAllowedOnRDN result code. The Modify DN
1535 Operation described in Section 4.9 is used to rename an entry.
1537 Note that due to the simplifications made in LDAP, there is not a
1538 direct mapping of the changes in an LDAP ModifyRequest onto the
1539 changes of a DAP ModifyEntry operation, and different implementations
1540 of LDAP-DAP gateways may use different means of representing the
1541 change. If successful, the final effect of the operations on the
1542 entry MUST be identical.
1547 The Add Operation allows a client to request the addition of an entry
1548 into the Directory. The Add Request is defined as follows:
1550 AddRequest ::= [APPLICATION 8] SEQUENCE {
1552 attributes AttributeList }
1554 AttributeList ::= SEQUENCE OF attribute Attribute
1556 Fields of the Add Request are:
1558 - entry: the name of the entry to be added. The server SHALL NOT
1559 dereference any aliases in locating the entry to be added.
1561 - attributes: the list of attributes that, along with those from the
1562 RDN, make up the content of the entry being added. Clients MUST
1563 include the 'objectClass' attribute, and values of any mandatory
1565 Sermersheim Internet-Draft - Expires Aug 2004 Page 27
\f
1566 Lightweight Directory Access Protocol Version 3
1568 attributes of the listed object classes. Clients MUST NOT supply
1569 NO-USER-MODIFICATION attributes such as the createTimestamp or
1570 creatorsName attributes, since the server maintains these
1573 The entry named in the entry field of the AddRequest MUST NOT exist
1574 for the AddRequest to succeed. The immediate superior (parent) of an
1575 object or alias entry to be added MUST exist. For example, if the
1576 client attempted to add <CN=JS,DC=Example,DC=NET>, the
1577 <DC=Example,DC=NET> entry did not exist, and the <DC=NET> entry did
1578 exist, then the server would return the noSuchObject result code with
1579 the matchedDN field containing <DC=NET>.
1581 If the entry to be added would not fall within a naming context
1582 [Section 5 of Models] held by the server, and the server has
1583 knowledge of where that entry is to be located, a referral to the
1584 server(s) holding the parent entry should be returned.
1586 Server implementations SHOULD NOT restrict where entries can be
1587 located in the Directory unless DIT structure rules are in place.
1588 Some servers allow the administrator to restrict the classes of
1589 entries which can be added to the Directory.
1591 Upon receipt of an Add Request, a server will attempt to add the
1592 requested entry. The result of the add attempt will be returned to
1593 the client in the Add Response, defined as follows:
1595 AddResponse ::= [APPLICATION 9] LDAPResult
1597 A response of success indicates that the new entry has been added to
1601 4.8. Delete Operation
1603 The Delete Operation allows a client to request the removal of an
1604 entry from the Directory. The Delete Request is defined as follows:
1606 DelRequest ::= [APPLICATION 10] LDAPDN
1608 The Delete Request consists of the name of the entry to be deleted.
1609 The server SHALL NOT dereference aliases while resolving the name of
1610 the target entry to be removed.
1612 Only leaf entries (those with no subordinate entries) can be deleted
1613 with this operation.
1615 Upon receipt of a Delete Request, a server will attempt to perform
1616 the entry removal requested and return the result in the Delete
1617 Response defined as follows:
1619 DelResponse ::= [APPLICATION 11] LDAPResult
1623 Sermersheim Internet-Draft - Expires Aug 2004 Page 28
\f
1624 Lightweight Directory Access Protocol Version 3
1626 4.9. Modify DN Operation
1628 The Modify DN Operation allows a client to change the Relative
1629 Distinguished Name (RDN) of an entry in the Directory, and/or to move
1630 a subtree of entries to a new location in the Directory. The Modify
1631 DN Request is defined as follows:
1633 ModifyDNRequest ::= [APPLICATION 12] SEQUENCE {
1635 newrdn RelativeLDAPDN,
1636 deleteoldrdn BOOLEAN,
1637 newSuperior [0] LDAPDN OPTIONAL }
1639 Fields of the Modify DN Request are:
1641 - entry: the name of the entry to be changed. This entry may or may
1642 not have subordinate entries.
1644 - newrdn: the new RDN of the entry. If an attribute value in the
1645 newrdn does not already exist in the entry (either as part of the
1646 old RDN or as a non-distinguished value), it is added. If it
1647 cannot be added, an appropriate error is returned.
1649 - deleteoldrdn: a boolean field that controls whether the old RDN
1650 attribute values are to be retained as attributes of the entry, or
1651 deleted from the entry.
1653 - newSuperior: if present, this is the name of an existing object
1654 entry which becomes the immediate superior (parent) of the
1657 The server SHALL NOT dereference any aliases in locating the objects
1658 named in entry or newSuperior.
1660 Upon receipt of a ModifyDNRequest, a server will attempt to perform
1661 the name change and return the result in the Modify DN Response,
1664 ModifyDNResponse ::= [APPLICATION 13] LDAPResult
1666 For example, if the entry named in the entry field was <cn=John
1667 Smith,c=US>, the newrdn field was <cn=John Cougar Smith>, and the
1668 newSuperior field was absent, then this operation would attempt to
1669 rename the entry to be <cn=John Cougar Smith,c=US>. If there was
1670 already an entry with that name, the operation would fail with the
1671 entryAlreadyExists result code.
1673 The object named in newSuperior MUST exist. For example, if the
1674 client attempted to add <CN=JS,DC=Example,DC=NET>, the
1675 <DC=Example,DC=NET> entry did not exist, and the <DC=NET> entry did
1676 exist, then the server would return the noSuchObject result code with
1677 the matchedDN field containing <DC=NET>.
1681 Sermersheim Internet-Draft - Expires Aug 2004 Page 29
\f
1682 Lightweight Directory Access Protocol Version 3
1684 If the deleteoldrdn field is TRUE, the attribute values forming the
1685 old RDN but not the new RDN are deleted from the entry. If the
1686 deleteoldrdn field is FALSE, the attribute values forming the old RDN
1687 will be retained as non-distinguished attribute values of the entry.
1688 The server MUST fail the operation and return an error in the result
1689 code if the setting of the deleteoldrdn field would cause a schema
1690 inconsistency in the entry.
1692 Note that X.500 restricts the ModifyDN operation to only affect
1693 entries that are contained within a single server. If the LDAP server
1694 is mapped onto DAP, then this restriction will apply, and the
1695 affectsMultipleDSAs result code will be returned if this error
1696 occurred. In general, clients MUST NOT expect to be able to perform
1697 arbitrary movements of entries and subtrees between servers or
1698 between naming contexts.
1701 4.10. Compare Operation
1703 The Compare Operation allows a client to compare an assertion value
1704 with the values of a particular attribute in a particular entry in
1705 the Directory. The Compare Request is defined as follows:
1707 CompareRequest ::= [APPLICATION 14] SEQUENCE {
1709 ava AttributeValueAssertion }
1711 Fields of the Compare Request are:
1713 - entry: the name of the entry to be compared. The server SHALL NOT
1714 dereference any aliases in locating the entry to be compared.
1716 - ava: holds the attribute description and assertion value with
1717 which an attribute in the entry is to be compared.
1719 Upon receipt of a Compare Request, a server will attempt to perform
1720 the requested comparison and return the result in the Compare
1721 Response, defined as follows:
1723 CompareResponse ::= [APPLICATION 15] LDAPResult
1725 The resultCode field is set to compareTrue, compareFalse, or an
1726 appropriate error. compareTrue indicates that the assertion value in
1727 the ava field is equivalent to a value of the attribute or subtype
1728 (according to the attribute's EQUALITY matching rule). compareFalse
1729 indicates that the comparison of the assertion value in the ava field
1730 and the values of the attribute or subtype resulted in an Undefined
1731 (Section 4.5.1) or non-equivalent match.
1733 In the event that the attribute or subtype is not present in the
1734 entry, the resultCode field is set to noSuchAttribute. If the
1735 attribute is unknown, the resultCode is set to
1736 undefinedAttributeType. If the attribute or subtype has no equality
1737 matching rule, innapropriateMatching is returned in the resultCode.
1739 Sermersheim Internet-Draft - Expires Aug 2004 Page 30
\f
1740 Lightweight Directory Access Protocol Version 3
1743 Note that some directory systems may establish access controls which
1744 permit the values of certain attributes (such as userPassword) to be
1745 compared but not interrogated by other means.
1748 4.11. Abandon Operation
1750 The function of the Abandon Operation is to allow a client to request
1751 that the server abandon an outstanding operation. The Abandon Request
1752 is defined as follows:
1754 AbandonRequest ::= [APPLICATION 16] MessageID
1756 The MessageID is that of an operation which was requested earlier in
1757 this LDAP association. The abandon request itself has its own message
1758 id. This is distinct from the id of the earlier operation being
1761 There is no response defined in the Abandon operation. Upon receipt
1762 of an AbandonRequest, the server MAY abandon the operation identified
1763 by the MessageID. Operation responses are not sent for successfully
1764 abandoned operations, thus the application of the Abandon operation
1765 is limited to uses where the client does not require an indication of
1768 Abandon, Bind, Unbind, and StartTLS operations cannot be abandoned.
1769 The ability to abandon other (particularly update) operations is at
1770 the discretion of the server.
1772 In the event that a server receives an Abandon Request on a Search
1773 Operation in the midst of transmitting responses to the search, that
1774 server MUST cease transmitting entry responses to the abandoned
1775 request immediately, and MUST NOT send the SearchResponseDone. Of
1776 course, the server MUST ensure that only properly encoded LDAPMessage
1777 PDUs are transmitted.
1779 Clients should not send abandon requests for the same operation
1780 multiple times, and MUST also be prepared to receive results from
1781 operations it has abandoned (since these may have been in transit
1782 when the abandon was requested, or are not able to be abandoned).
1784 Servers MUST discard abandon requests for message IDs they do not
1785 recognize, for operations which cannot be abandoned, and for
1786 operations which have already been abandoned.
1789 4.12. Extended Operation
1791 The extended operation allows additional operations to be defined for
1792 services not already available in the protocol. For example, to add
1793 operations to install transport layer security (see Section 4.14).
1797 Sermersheim Internet-Draft - Expires Aug 2004 Page 31
\f
1798 Lightweight Directory Access Protocol Version 3
1800 The extended operation allows clients to make requests and receive
1801 responses with predefined syntaxes and semantics. These may be
1802 defined in RFCs or be private to particular implementations.
1804 Each extended operation consists of an extended request and an
1807 ExtendedRequest ::= [APPLICATION 23] SEQUENCE {
1808 requestName [0] LDAPOID,
1809 requestValue [1] OCTET STRING OPTIONAL }
1811 The requestName is a dotted-decimal representation of the unique
1812 OBJECT IDENTIFIER corresponding to the request. The requestValue is
1813 information in a form defined by that request, encapsulated inside an
1816 The server will respond to this with an LDAPMessage containing an
1819 ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
1820 COMPONENTS OF LDAPResult,
1821 responseName [10] LDAPOID OPTIONAL,
1822 responseValue [11] OCTET STRING OPTIONAL }
1824 The responseName is typically not required to be present as the
1825 syntax and semantics of the response (including the format of the
1826 responseValue) is implicitly known and associated with the request by
1829 If the requestName is not recognized by the server, the server MUST
1830 NOT provide a responseName nor a responseValue and MUST return a
1831 resultCode of protocolError.
1833 The requestValue and responseValue fields contain any information
1834 associated with the operation. The format of these fields is defined
1835 by the specification of the extended operation. Implementations MUST
1836 be prepared to handle arbitrary contents of these fields, including
1837 zero bytes. Values that are defined in terms of ASN.1 and BER encoded
1838 according to Section 5.1, also follow the extensibility rules in
1841 It is RECOMMENDED that servers list the requestName of extended
1842 operations they support in the 'supportedExtension' attribute of the
1845 Extended operations may be specified in other documents. The
1846 specification of an extended operation consists of:
1848 - the OBJECT IDENTIFIER assigned to the requestName (and possibly
1851 - the format of the contents of the requestValue and responseValue
1855 Sermersheim Internet-Draft - Expires Aug 2004 Page 32
\f
1856 Lightweight Directory Access Protocol Version 3
1858 - the semantics of the operation.
1861 4.13. IntermediateResponse Message
1863 While the Search operation provides a mechanism to return multiple
1864 response messages for a single search request, other operations, by
1865 nature, do not provide for multiple response messages.
1867 The IntermediateResponse message provides a general mechanism for
1868 defining single-request/multiple-response operations in LDAP. This
1869 message is intended to be used in conjunction with the extended
1870 operation to define new single-request/multiple-response operations
1871 or in conjunction with a control when extending existing LDAP
1872 operations in a way that requires them to return intermediate
1873 response information.
1875 It is intended that the definitions and descriptions of extended
1876 operations and controls that make use of the IntermediateResponse
1877 message will define the circumstances when an IntermediateResponse
1878 message can be sent by a server and the associated meaning of an
1879 IntermediateResponse message sent in a particular circumstance.
1880 Similarly, it is intended that clients will explicitly solicit
1881 IntermediateResponse messages by issuing operations that specifically
1882 call for their return.
1884 IntermediateResponse ::= [APPLICATION 25] SEQUENCE {
1885 responseName [0] LDAPOID OPTIONAL,
1886 responseValue [1] OCTET STRING OPTIONAL }
1888 IntermediateResponse messages SHALL NOT be returned to the client
1889 unless the client issues a request that specifically solicits their
1890 return. This document defines two forms of solicitation: extended
1891 operation and request control.
1893 Although the responseName and responseValue are optional in some
1894 circumstances, generally speaking IntermediateResponse messages have
1895 a predefined responseName and a responseValue. The value of the
1896 responseName (if present), the syntax of the responseValue (if
1897 present) and the semantics associated with a particular
1898 IntermediateResponse message MUST be specified in documents
1899 describing the extended operation or request control that uses them.
1900 Sections 4.13.1 and 4.13.2 describe additional requirements on the
1901 inclusion of responseName and responseValue in IntermediateResponse
1905 4.13.1. Usage with LDAP ExtendedRequest and ExtendedResponse
1907 A single-request/multiple-response operation may be defined using a
1908 single ExtendedRequest message to solicit zero or more
1909 IntermediateResponse messages of one or more kinds followed by an
1910 ExtendedResponse message.
1913 Sermersheim Internet-Draft - Expires Aug 2004 Page 33
\f
1914 Lightweight Directory Access Protocol Version 3
1916 An extended operation that defines the return of multiple kinds of
1917 IntermediateResponse messages MUST provide and document a mechanism
1918 for the client to distinguish the kind of IntermediateResponse
1919 message being sent. This SHALL be accomplished by using different
1920 responseName values for each type of IntermediateResponse message
1921 associated with the extended operation or by including identifying
1922 information in the responseValue of each type of IntermediateResponse
1923 message associated with the extended operation.
1926 4.13.2. Usage with LDAP Request Controls
1928 Any LDAP operation may be extended by the addition of one or more
1929 controls ([RFC2251] Section 4.1.12). A control's semantics may
1930 include the return of zero or more IntermediateResponse messages
1931 prior to returning the final result code for the operation. One or
1932 more kinds of IntermediateResponse messages may be sent in response
1933 to a request control.
1935 All IntermediateResponse messages associated with request controls
1936 SHALL include a responseName. This requirement ensures that the
1937 client can correctly identify the source of IntermediateResponse
1940 - two or more controls using IntermediateResponse messages are
1941 included in a request for any LDAP operation or
1943 - one or more controls using IntermediateResponse messages are
1944 included in a request with an LDAP extended operation that uses
1945 IntermediateResponse messages.
1947 A request control that defines the return of multiple kinds of
1948 IntermediateResponse messages MUST provide and document a mechanism
1949 for the client to distinguish the kind of IntermediateResponse
1950 message being sent. This SHALL be accomplished by using different
1951 responseName values for each type of IntermediateResponse message
1952 associated with the request control or by including identifying
1953 information in the responseValue of each type of IntermediateResponse
1954 message associated with the request control.
1957 4.14. StartTLS Operation
1959 The Start Transport Layer Security (StartTLS) operation provides the
1960 ability to establish Transport Layer Security ([TLS]) on an LDAP
1961 connection. The StartTLS operation is defined using the extended
1962 operation mechanism described in Section 4.12.
1965 4.14.1. StartTLS Request
1967 A client requests TLS establishment by transmitting a StartTLS
1968 request PDU to the server. The StartTLS request is defined in terms
1970 Sermersheim Internet-Draft - Expires Aug 2004 Page 34
\f
1971 Lightweight Directory Access Protocol Version 3
1973 of an ExtendedRequest. The requestName is "1.3.6.1.4.1.1466.20037",
1974 and the requestValue field is always absent.
1976 The client MUST NOT send any PDUs on this connection following this
1977 request until it receives a StartTLS extended response and completes
1981 4.14.2. StartTLS Response
1983 When a StartTLS request is made, servers supporting the operation
1984 MUST return a StartTLS response PDU to the requestor. The
1985 responseName is also "1.3.6.1.4.1.1466.20037", and the responseValue
1988 The server provides a resultCode field to either success or one of
1989 the other values outlined in Section 4.14.2.2.
1992 4.14.2.1. "Success" Response
1994 If the StartTLS Response contains a resultCode of success, this
1995 indicates that the server is willing and able to negotiate TLS. Refer
1996 to Section 4 of [AuthMeth] for details.
1999 4.14.2.2. Response other than "success"
2001 If the ExtendedResponse contains a result code other than success,
2002 this indicates that the server is unwilling or unable to negotiate
2003 TLS. The following result codes have these meanings for this
2006 - operationsError: operations sequencing incorrect; e.g. TLS is
2007 already established.
2009 - protocolError: TLS is not supported or incorrect PDU structure.
2011 - unavailable: Some major problem with TLS, or the server is
2014 The server MUST return operationsError if the client violates any of
2015 the StartTLS extended operation sequencing requirements described in
2016 Section 4 of [AuthMeth].
2018 If the server does not support TLS (whether by design or by current
2019 configuration), it MUST return the protocolError resultCode. The
2020 client's current association is unaffected if the server does not
2021 support TLS. The client may proceed with any LDAP operation, or it
2022 may close the connection.
2024 The server MUST return unavailable if it supports TLS but cannot
2025 establish a TLS connection for some reason, e.g. the certificate
2027 Sermersheim Internet-Draft - Expires Aug 2004 Page 35
\f
2028 Lightweight Directory Access Protocol Version 3
2030 server not responding, it cannot contact its TLS implementation, or
2031 if the server is in process of shutting down. The client may retry
2032 the StartTLS operation, or it may proceed with any other LDAP
2033 operation, or it may close the LDAP connection.
2036 4.14.3. Closing a TLS Connection
2038 Two forms of TLS connection closure -- graceful and abrupt -- are
2039 supported. These do not involve LDAP PDUs, but are preformed at the
2043 4.14.3.1. Graceful Closure
2045 Either the client or server MAY terminate the TLS connection and
2046 leave the LDAP connection intact by sending and receiving a TLS
2049 The initiating protocol peer sends the TLS closure alert. If it
2050 wishes to leave the LDAP connection intact, it then MUST cease to
2051 send further PDUs and MUST ignore any received PDUs until it receives
2052 a TLS closure alert from the other peer.
2054 Once the initiating protocol peer receives a TLS closure alert from
2055 the other peer it MAY send and receive LDAP PDUs.
2057 When a protocol peer receives the initial TLS closure alert, it may
2058 choose to allow the underlying LDAP connection to remain intact. In
2059 this case, it MUST immediately transmit a TLS closure alert.
2060 Following this, it MAY send and receive LDAP PDUs.
2062 Protocol peers MAY drop the underlying LDAP connection after sending
2063 or receiving a TLS closure alert.
2065 After the TLS connection has been closed, the server MUST NOT send
2066 responses to any request message received before the TLS closure.
2067 Thus, clients wishing to receive responses to messages sent while the
2068 TLS connection is intact MUST wait for those message responses before
2069 sending the TLS closure alert.
2072 4.14.3.2. Abrupt Closure
2074 Either the client or server MAY abruptly close the TLS connection by
2075 dropping the underlying transfer protocol connection. In this
2076 circumstance, a server MAY send the client a Notice of Disconnection
2077 before dropping the underlying LDAP connection. Outstanding
2078 operations are handled as specified in Section 5.2.
2081 5. Protocol Element Encodings and Transfer
2084 Sermersheim Internet-Draft - Expires Aug 2004 Page 36
\f
2085 Lightweight Directory Access Protocol Version 3
2088 One underlying service, LDAP over TCP, is defined here. This service
2089 is generally applicable to applications providing or consuming X.500-
2090 based directory services on the Internet.
2092 Implementations of LDAP over TCP MUST implement the mapping as
2093 described in Section 5.2.1
2096 5.1. Protocol Encoding
2098 The protocol elements of LDAP SHALL be encoded for exchange using the
2099 Basic Encoding Rules [BER] of [ASN.1] with the following
2102 - Only the definite form of length encoding is used.
2104 - OCTET STRING values are encoded in the primitive form only.
2106 - If the value of a BOOLEAN type is true, the encoding of the value
2107 octet is set to hex "FF".
2109 - If a value of a type is its default value, it is absent. Only some
2110 BOOLEAN and INTEGER types have default values in this protocol
2113 These restrictions are meant to ease the overhead of encoding and
2114 decoding certain elements in BER.
2116 These restrictions do not apply to ASN.1 types encapsulated inside of
2117 OCTET STRING values, such as attribute values, unless otherwise
2121 5.2. Transfer Protocols
2123 This protocol is designed to run over connection-oriented, reliable
2124 transports, with all 8 bits in an octet being significant in the data
2125 stream. Protocol operations are tied to a connection, thus if the
2126 connection is closed or dropped, the operation is aborted. When this
2127 happens, any outstanding operations on the server are, when possible,
2128 abandoned, and when not possible, completed without transmission of
2129 the response. Also, if the connection is closed or dropped, the
2130 client MUST NOT assume that any outstanding requests which modified
2131 the Directory have succeeded or failed.
2134 5.2.1. Transmission Control Protocol (TCP)
2136 The encoded LDAPMessage PDUs are mapped directly onto the [TCP]
2137 bytestream using the BER-based encoding described in Section 5.1. It
2138 is recommended that server implementations running over the TCP
2139 provide a protocol listener on the Internet Assigned Numbers
2140 Authority (IANA)-assigned LDAP port, 389 [PortReg]. Servers may
2142 Sermersheim Internet-Draft - Expires Aug 2004 Page 37
\f
2143 Lightweight Directory Access Protocol Version 3
2145 instead provide a listener on a different port number. Clients MUST
2146 support contacting servers on any valid TCP port.
2149 6. Security Considerations
2151 This version of the protocol provides facilities for simple
2152 authentication using a cleartext password, as well as any [SASL]
2153 mechanism. SASL allows for integrity and privacy services to be
2156 It is also permitted that the server can return its credentials to
2157 the client, if it chooses to do so.
2159 Use of cleartext password is strongly discouraged where the
2160 underlying transport service cannot guarantee confidentiality and may
2161 result in disclosure of the password to unauthorized parties.
2163 Servers are encouraged to prevent directory modifications by clients
2164 that have authenticated anonymously [AuthMeth].
2166 Requirements of authentication methods, SASL mechanisms, and TLS are
2167 described in [AuthMeth].
2169 It should be noted that SASL authentication exchanges do not provide
2170 data confidentiality nor integrity protection for the version or name
2171 fields of the bind request nor the resultCode, diagnosticMessage, or
2172 referral fields of the bind response nor of any information contained
2173 in controls attached to bind request or responses. Thus information
2174 contained in these fields SHOULD NOT be relied on unless otherwise
2175 protected (such as by establishing protections at the transport
2178 Server implementors should plan for the possibility of an identity
2179 associated with an LDAP connection being deleted, renamed, or
2180 modified, and take appropriate actions to prevent insecure side
2181 effects. Likewise, server implementors should plan for the
2182 possibility of an associated identity's credentials becoming invalid,
2183 or an identity's privileges being changed. The ways in which these
2184 issues are addressed are application and/or implementation specific.
2186 Implementations which cache attributes and entries obtained via LDAP
2187 MUST ensure that access controls are maintained if that information
2188 is to be provided to multiple clients, since servers may have access
2189 control policies which prevent the return of entries or attributes in
2190 search results except to particular authenticated clients. For
2191 example, caches could serve result information only to the client
2192 whose request caused it to be in the cache.
2194 Servers may return referrals or search result references which
2195 redirect clients to peer servers. It is possible for a rogue
2196 application to inject such referrals into the data stream in an
2197 attempt to redirect a client to a rogue server. Clients are advised
2198 to be aware of this, and possibly reject referrals when
2200 Sermersheim Internet-Draft - Expires Aug 2004 Page 38
\f
2201 Lightweight Directory Access Protocol Version 3
2203 confidentiality measures are not in place. Clients are advised to
2204 reject referrals from the StartTLS operation.
2206 The matchedDN and diagnosticMessage fields, as well as some
2207 resultCode values (e.g., attributeOrValueExists and
2208 entryAlreadyExists), could disclose the presence the specific data in
2209 the directory which is subject to access and other administrative
2210 controls. Server implementations should restrict access to protected
2211 information equally under both normal and error conditions.
2213 Protocol peers MUST be prepared to handle invalid and arbitrary
2214 length protocol encodings. A number of LDAP security advisories are
2215 available through [CERT].
2220 This document is based on RFC 2251 by Mark Wahl, Tim Howes, and Steve
2221 Kille. It is also based on RFC 2830 by Jeff Hodges, RL "Bob" Morgan,
2222 and Mark Wahl. It is also based on [LIMR] by Roger Harrison, and Kurt
2223 Zeilenga. Notable amounts of technical reviews and content were
2224 provided by Kurt Zeilenga, Steven Legg, and Hallvard Furuseth. Their
2225 work along with the input of individuals of the IETF ASID, LDAPEXT,
2226 LDUP, LDAPBIS, and other Working Groups is gratefully acknowledged.
2229 8. Normative References
2231 [ABNF] Crocker, D. and P. Overell, "Augmented BNF for Syntax
2232 Specifications: ABNF", RFC 2234, November 1997.
2234 [ASN.1] ITU-T Recommendation X.680 (07/2002) | ISO/IEC 8824-1:2002
2235 "Information Technology - Abstract Syntax Notation One
2236 (ASN.1): Specification of basic notation"
2238 [AuthMeth] Harrison, R., "LDAP: Authentication Methods and Connection
2239 Level Security Mechanisms", draft-ietf-ldapbis-authmeth-
2240 xx.txt, (a work in progress).
2242 [BER] ITU-T Rec. X.690 (07/2002) | ISO/IEC 8825-1:2002,
2243 "Information technology - ASN.1 encoding rules:
2244 Specification of Basic Encoding Rules (BER), Canonical
2245 Encoding Rules (CER) and Distinguished Encoding Rules
2248 [IP] Postel, J., "Internet Protocol", STD5 and RFC 791,
2251 [ISO10646] Universal Multiple-Octet Coded Character Set (UCS) -
2252 Architecture and Basic Multilingual Plane, ISO/IEC 10646-1
2255 [Keyword] Bradner, S., "Key words for use in RFCs to Indicate
2256 Requirement Levels", RFC 2119, March 1997.
2258 Sermersheim Internet-Draft - Expires Aug 2004 Page 39
\f
2259 Lightweight Directory Access Protocol Version 3
2262 [LDAPDN] Zeilenga, K., "LDAP: String Representation of
2263 Distinguished Names", draft-ietf-ldapbis-dn-xx.txt, (a
2266 [LDAPIANA] Zeilenga, K., "IANA Considerations for LDAP", draft-ietf-
2267 ldapbis-bcp64-xx.txt, (a work in progress).
2269 [LDAPURL] Smith, M., "LDAP: Uniform Resource Locator", draft-ietf-
2270 ldapbis-url-xx.txt, (a work in progress).
2272 [LIMR] Harrison, R., and K. Zeilenga, "The Lightweight Directory
2273 Access Protocol (LDAP) Intermediate Response Message",
2274 draft-rharrison-ldap-intermediate-resp-xx.txt (a work in
2277 [Models] Zeilenga, K., "LDAP: Directory Information Models", draft-
2278 ietf-ldapbis-models-xx.txt (a work in progress).
2280 [Roadmap] Zeilenga, K., "LDAP: Technical Specification Road Map",
2281 draft-ietf-ldapbis-roadmap-xx.txt (a work in progress).
2283 [SASL] Melnikov, A., "Simple Authentication and Security Layer",
2284 draft-ietf-sasl-rfc2222bis-xx.txt (a work in progress).
2286 [SASLPrep] Zeilenga, K., "Stringprep profile for user names and
2287 passwords", draft-ietf-sasl-saslprep-xx.txt, (a work in
2290 [StringPrep] Hoffman P. and M. Blanchet, "Preparation of
2291 Internationalized Strings ('stringprep')", draft-hoffman-
2292 rfc3454bis-xx.txt, a work in progress.
2294 [Syntaxes] Legg, S., and K. Dally, "LDAP: Syntaxes and Matching
2295 Rules", draft-ietf-ldapbis-syntaxes-xx.txt, (a work in
2298 [TCP] Postel, J., "Transmission Control Protocol", STD7 and RFC
2301 [TLS] Dierks, T. and C. Allen. "The TLS Protocol Version 1.1",
2302 draft-ietf-tls-rfc2246-bis-xx.txt, a work in progress.
2304 [Unicode] The Unicode Consortium, "The Unicode Standard, Version
2305 3.2.0" is defined by "The Unicode Standard, Version 3.0"
2306 (Reading, MA, Addison-Wesley, 2000. ISBN 0-201-61633-5),
2307 as amended by the "Unicode Standard Annex #27: Unicode
2308 3.1" (http://www.unicode.org/reports/tr27/) and by the
2309 "Unicode Standard Annex #28: Unicode 3.2"
2310 (http://www.unicode.org/reports/tr28/).
2312 [URI] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
2313 Resource Identifiers (URI): Generic Syntax", RFC 2396,
2316 Sermersheim Internet-Draft - Expires Aug 2004 Page 40
\f
2317 Lightweight Directory Access Protocol Version 3
2320 [UTF-8] Yergeau, F., "UTF-8, a transformation format of ISO
2321 10646", STD63 and RFC3629, November 2003.
2323 [X.500] ITU-T Rec. X.500, "The Directory: Overview of Concepts,
2324 Models and Service", 1993.
2326 [X.501] ITU-T Rec. X.501, "The Directory: Models", 1993.
2328 [X.511] ITU-T Rec. X.511, "The Directory: Abstract Service
2332 9. Informative References
2334 [CERT] The CERT(R) Center, http://www.cert.org
2336 [PortReg] IANA, "Port Numbers",
2337 http://www.iana.org/assignments/port-numbers
2340 10. IANA Considerations
2342 It is requested that the Internet Assigned Numbers Authority (IANA)
2343 update the LDAP result code registry to indicate that this document
2344 provides the definitive technical specification for result codes 0-
2345 36, 48-54, 64-70, 80-90.
2347 It is requested that the IANA update the LDAP Protocol Mechanism
2348 registry to indicate that this document and [AuthMeth] provides the
2349 definitive technical specification for the Start TLS
2350 (1.3.6.1.4.1.1466.20037) extended operation.
2352 It is requested that the IANA update the occurrence of "RFC XXXX" in
2353 Appendix B with this RFC number at publication.
2356 11. Editor's Address
2360 1800 South Novell Place
2361 Provo, Utah 84606, USA
2374 Sermersheim Internet-Draft - Expires Aug 2004 Page 41
\f
2375 Lightweight Directory Access Protocol Version 3
2377 Appendix A - LDAP Result Codes
2379 This normative appendix details additional considerations regarding
2380 LDAP result codes and provides a brief, general description of each
2381 LDAP result code enumerated in Section 4.1.9.
2383 Additional result codes MAY be defined for use with extensions
2384 [LDAPIANA]. Client implementations SHALL treat any result code which
2385 they do not recognize as an unknown error condition.
2388 A.1 Non-Error Result Codes
2390 These result codes (called "non-error" result codes) do not indicate
2396 saslBindInProgress (14).
2398 The success, compareTrue, and compareFalse result codes indicate
2399 successful completion (and, hence, are referred to as "successful"
2402 The referral and saslBindInProgress result codes indicate the client
2403 is required to take additional action to complete the operation.
2408 Existing LDAP result codes are described as follows:
2411 Indicates the successful completion of an operation. Note:
2412 this code is not used with the compare operation. See
2413 compareTrue (5) and compareFalse (6).
2416 Indicates that the operation is not properly sequenced with
2417 relation to other operations (of same or different type).
2419 For example, this code is returned if the client attempts to
2420 StartTLS [TLS] while there are other operations outstanding
2421 or if TLS was already established.
2424 Indicates the server received data which has incorrect
2427 For bind operation only, this code is also used to indicate
2428 that the server does not support the requested protocol
2432 Sermersheim Internet-Draft - Expires Aug 2004 Page 42
\f
2433 Lightweight Directory Access Protocol Version 3
2435 timeLimitExceeded (3)
2436 Indicates that the time limit specified by the client was
2437 exceeded before the operation could be completed.
2439 sizeLimitExceeded (4)
2440 Indicates that the size limit specified by the client was
2441 exceeded before the operation could be completed.
2444 Indicates that the compare operation has successfully
2445 completed and the assertion has evaluated to FALSE.
2448 Indicates that the compare operation has successfully
2449 completed and the assertion has evaluated to TRUE.
2451 authMethodNotSupported (7)
2452 Indicates that the authentication method or mechanism is not
2455 strongAuthRequired (8)
2456 Indicates that the server has detected that an established
2457 security association between the client and server has
2458 unexpectedly failed or been compromised, or that the server
2459 now requires the client to authenticate using a strong(er)
2463 Indicates that a referral needs to be chased to complete the
2464 operation (see Section 4.1.10).
2466 adminLimitExceeded (11)
2467 Indicates that an administrative limit has been exceeded.
2469 unavailableCriticalExtension (12)
2470 Indicates that the server is unable or unwilling to perform a
2471 critical control (see Section 4.1.11).
2473 confidentialityRequired (13)
2474 Indicates that data confidentiality protections are required.
2476 saslBindInProgress (14)
2477 Indicates the server requires the client to send a new bind
2478 request, with the same SASL mechanism, to continue the
2479 authentication process (see Section 4.2).
2481 noSuchAttribute (16)
2482 Indicates that the named entry does not contain the specified
2483 attribute or attribute value.
2485 undefinedAttributeType (17)
2486 Indicates that a request field contains an unrecognized
2487 attribute description.
2490 Sermersheim Internet-Draft - Expires Aug 2004 Page 43
\f
2491 Lightweight Directory Access Protocol Version 3
2493 inappropriateMatching (18)
2494 Indicates that an attempt was made, e.g. in an assertion, to
2495 use a matching rule not defined for the attribute type
2498 constraintViolation (19)
2499 Indicates that the client supplied an attribute value which
2500 does not conform to the constraints placed upon it by the
2503 For example, this code is returned when multiple values are
2504 supplied to an attribute which has a SINGLE-VALUE constraint.
2506 attributeOrValueExists (20)
2507 Indicates that the client supplied an attribute or value to
2508 be added to an entry, but the attribute or value already
2511 invalidAttributeSyntax (21)
2512 Indicates that a purported attribute value does not conform
2513 to the syntax of the attribute.
2516 Indicates that the object does not exist in the DIT.
2519 Indicates that an alias problem has occurred. For example,
2520 the code may used to indicate an alias has been dereferenced
2521 which names no object.
2523 invalidDNSyntax (34)
2524 Indicates that an LDAPDN or RelativeLDAPDN field (e.g. search
2525 base, target entry, ModifyDN newrdn, etc.) of a request does
2526 not conform to the required syntax or contains attribute
2527 values which do not conform to the syntax of the attribute's
2530 aliasDereferencingProblem (36)
2531 Indicates that a problem occurred while dereferencing an
2532 alias. Typically an alias was encountered in a situation
2533 where it was not allowed or where access was denied.
2535 inappropriateAuthentication (48)
2536 Indicates the server requires the client which had attempted
2537 to bind anonymously or without supplying credentials to
2538 provide some form of credentials.
2540 invalidCredentials (49)
2541 Indicates that the provided credentials (e.g. the user's name
2542 and password) are invalid.
2544 insufficientAccessRights (50)
2545 Indicates that the client does not have sufficient access
2546 rights to perform the operation.
2548 Sermersheim Internet-Draft - Expires Aug 2004 Page 44
\f
2549 Lightweight Directory Access Protocol Version 3
2553 Indicates that the server is too busy to service the
2557 Indicates that the server is shutting down or a subsystem
2558 necessary to complete the operation is offline.
2560 unwillingToPerform (53)
2561 Indicates that the server is unwilling to perform the
2565 Indicates that the server has detected an internal loop (e.g.
2566 while dereferencing aliases or chaining an operation).
2568 namingViolation (64)
2569 Indicates that the entry's name violates naming restrictions.
2571 objectClassViolation (65)
2572 Indicates that the entry violates object class restrictions.
2574 notAllowedOnNonLeaf (66)
2575 Indicates that the operation is inappropriately acting upon a
2578 notAllowedOnRDN (67)
2579 Indicates that the operation is inappropriately attempting to
2580 remove a value which forms the entry's relative distinguished
2583 entryAlreadyExists (68)
2584 Indicates that the request cannot be fulfilled (added, moved,
2585 or renamed) as the target entry already exists.
2587 objectClassModsProhibited (69)
2588 Indicates that an attempt to modify the object class(es) of
2589 an entry's 'objectClass' attribute is prohibited.
2591 For example, this code is returned when a client attempts to
2592 modify the structural object class of an entry.
2594 affectsMultipleDSAs (71)
2595 Indicates that the operation cannot be completed as it
2596 affects multiple servers (DSAs).
2599 Indicates the server has encountered an internal error.
2606 Sermersheim Internet-Draft - Expires Aug 2004 Page 45
\f
2607 Lightweight Directory Access Protocol Version 3
2609 Appendix B - Complete ASN.1 Definition
2611 This appendix is normative.
2613 Lightweight-Directory-Access-Protocol-V3
2614 -- Copyright (C) The Internet Society (2003). This version of
2615 -- this ASN.1 module is part of RFC XXXX; see the RFC itself
2616 -- for full legal notices.
2619 EXTENSIBILITY IMPLIED ::=
2623 LDAPMessage ::= SEQUENCE {
2624 messageID MessageID,
2626 bindRequest BindRequest,
2627 bindResponse BindResponse,
2628 unbindRequest UnbindRequest,
2629 searchRequest SearchRequest,
2630 searchResEntry SearchResultEntry,
2631 searchResDone SearchResultDone,
2632 searchResRef SearchResultReference,
2633 modifyRequest ModifyRequest,
2634 modifyResponse ModifyResponse,
2635 addRequest AddRequest,
2636 addResponse AddResponse,
2637 delRequest DelRequest,
2638 delResponse DelResponse,
2639 modDNRequest ModifyDNRequest,
2640 modDNResponse ModifyDNResponse,
2641 compareRequest CompareRequest,
2642 compareResponse CompareResponse,
2643 abandonRequest AbandonRequest,
2644 extendedReq ExtendedRequest,
2645 extendedResp ExtendedResponse,
2646 intermediateResponse IntermediateResponse
2648 controls [0] Controls OPTIONAL }
2650 MessageID ::= INTEGER (0 .. maxInt)
2652 maxInt INTEGER ::= 2147483647 -- (2^^31 - 1) --
2654 LDAPString ::= OCTET STRING -- UTF-8 encoded,
2655 -- [ISO10646] characters
2657 LDAPOID ::= OCTET STRING -- Constrained to <numericoid> [Models]
2659 LDAPDN ::= LDAPString -- Constrained to <distinguishedName>
2662 RelativeLDAPDN ::= LDAPString -- Constrained to <name-component>
2664 Sermersheim Internet-Draft - Expires Aug 2004 Page 46
\f
2665 Lightweight Directory Access Protocol Version 3
2669 AttributeDescription ::= LDAPString
2670 -- Constrained to <attributedescription>
2673 AttributeValue ::= OCTET STRING
2675 AttributeValueAssertion ::= SEQUENCE {
2676 attributeDesc AttributeDescription,
2677 assertionValue AssertionValue }
2679 AssertionValue ::= OCTET STRING
2681 PartialAttribute ::= SEQUENCE {
2682 type AttributeDescription,
2683 vals SET OF value AttributeValue }
2685 Attribute ::= PartialAttribute(WITH COMPONENTS {
2687 vals (SIZE(1..MAX))})
2689 MatchingRuleId ::= LDAPString
2691 LDAPResult ::= SEQUENCE {
2692 resultCode ENUMERATED {
2694 operationsError (1),
2696 timeLimitExceeded (3),
2697 sizeLimitExceeded (4),
2700 authMethodNotSupported (7),
2701 strongAuthRequired (8),
2704 adminLimitExceeded (11),
2705 unavailableCriticalExtension (12),
2706 confidentialityRequired (13),
2707 saslBindInProgress (14),
2708 noSuchAttribute (16),
2709 undefinedAttributeType (17),
2710 inappropriateMatching (18),
2711 constraintViolation (19),
2712 attributeOrValueExists (20),
2713 invalidAttributeSyntax (21),
2717 invalidDNSyntax (34),
2718 -- 35 reserved for undefined isLeaf --
2719 aliasDereferencingProblem (36),
2722 Sermersheim Internet-Draft - Expires Aug 2004 Page 47
\f
2723 Lightweight Directory Access Protocol Version 3
2725 inappropriateAuthentication (48),
2726 invalidCredentials (49),
2727 insufficientAccessRights (50),
2730 unwillingToPerform (53),
2733 namingViolation (64),
2734 objectClassViolation (65),
2735 notAllowedOnNonLeaf (66),
2736 notAllowedOnRDN (67),
2737 entryAlreadyExists (68),
2738 objectClassModsProhibited (69),
2739 -- 70 reserved for CLDAP --
2740 affectsMultipleDSAs (71),
2745 diagnosticMessage LDAPString,
2746 referral [3] Referral OPTIONAL }
2748 Referral ::= SEQUENCE SIZE (1..MAX) OF uri URI
2750 URI ::= LDAPString -- limited to characters permitted in
2753 Controls ::= SEQUENCE OF control Control
2755 Control ::= SEQUENCE {
2756 controlType LDAPOID,
2757 criticality BOOLEAN DEFAULT FALSE,
2758 controlValue OCTET STRING OPTIONAL }
2760 BindRequest ::= [APPLICATION 0] SEQUENCE {
2761 version INTEGER (1 .. 127),
2763 authentication AuthenticationChoice }
2765 AuthenticationChoice ::= CHOICE {
2766 simple [0] OCTET STRING,
2768 sasl [3] SaslCredentials,
2771 SaslCredentials ::= SEQUENCE {
2772 mechanism LDAPString,
2773 credentials OCTET STRING OPTIONAL }
2775 BindResponse ::= [APPLICATION 1] SEQUENCE {
2776 COMPONENTS OF LDAPResult,
2777 serverSaslCreds [7] OCTET STRING OPTIONAL }
2780 Sermersheim Internet-Draft - Expires Aug 2004 Page 48
\f
2781 Lightweight Directory Access Protocol Version 3
2783 UnbindRequest ::= [APPLICATION 2] NULL
2785 SearchRequest ::= [APPLICATION 3] SEQUENCE {
2791 derefAliases ENUMERATED {
2792 neverDerefAliases (0),
2793 derefInSearching (1),
2794 derefFindingBaseObj (2),
2796 sizeLimit INTEGER (0 .. maxInt),
2797 timeLimit INTEGER (0 .. maxInt),
2800 attributes AttributeSelection }
2802 AttributeSelection ::= SEQUENCE OF selection LDAPString
2803 -- constrained to <attributeSelection>
2804 -- in section 4.5.1.
2807 and [0] SET SIZE (1..MAX) OF filter Filter,
2808 or [1] SET SIZE (1..MAX) OF filter Filter,
2810 equalityMatch [3] AttributeValueAssertion,
2811 substrings [4] SubstringFilter,
2812 greaterOrEqual [5] AttributeValueAssertion,
2813 lessOrEqual [6] AttributeValueAssertion,
2814 present [7] AttributeDescription,
2815 approxMatch [8] AttributeValueAssertion,
2816 extensibleMatch [9] MatchingRuleAssertion }
2818 SubstringFilter ::= SEQUENCE {
2819 type AttributeDescription,
2820 -- at least one must be present,
2821 -- initial and final can occur at most once
2822 substrings SEQUENCE SIZE (1..MAX) OF substring CHOICE {
2823 initial [0] AssertionValue,
2824 any [1] AssertionValue,
2825 final [2] AssertionValue } }
2827 MatchingRuleAssertion ::= SEQUENCE {
2828 matchingRule [1] MatchingRuleId OPTIONAL,
2829 type [2] AttributeDescription OPTIONAL,
2830 matchValue [3] AssertionValue,
2831 dnAttributes [4] BOOLEAN DEFAULT FALSE }
2833 SearchResultEntry ::= [APPLICATION 4] SEQUENCE {
2835 attributes PartialAttributeList }
2838 Sermersheim Internet-Draft - Expires Aug 2004 Page 49
\f
2839 Lightweight Directory Access Protocol Version 3
2841 PartialAttributeList ::= SEQUENCE OF
2842 partialAttribute PartialAttribute
2844 SearchResultReference ::= [APPLICATION 19] SEQUENCE
2845 SIZE (1..MAX) OF uri URI
2847 SearchResultDone ::= [APPLICATION 5] LDAPResult
2849 ModifyRequest ::= [APPLICATION 6] SEQUENCE {
2851 changes SEQUENCE OF change SEQUENCE {
2852 operation ENUMERATED {
2856 modification PartialAttribute } }
2858 ModifyResponse ::= [APPLICATION 7] LDAPResult
2860 AddRequest ::= [APPLICATION 8] SEQUENCE {
2862 attributes AttributeList }
2864 AttributeList ::= SEQUENCE OF attribute Attribute
2866 AddResponse ::= [APPLICATION 9] LDAPResult
2868 DelRequest ::= [APPLICATION 10] LDAPDN
2870 DelResponse ::= [APPLICATION 11] LDAPResult
2872 ModifyDNRequest ::= [APPLICATION 12] SEQUENCE {
2874 newrdn RelativeLDAPDN,
2875 deleteoldrdn BOOLEAN,
2876 newSuperior [0] LDAPDN OPTIONAL }
2878 ModifyDNResponse ::= [APPLICATION 13] LDAPResult
2880 CompareRequest ::= [APPLICATION 14] SEQUENCE {
2882 ava AttributeValueAssertion }
2884 CompareResponse ::= [APPLICATION 15] LDAPResult
2886 AbandonRequest ::= [APPLICATION 16] MessageID
2888 ExtendedRequest ::= [APPLICATION 23] SEQUENCE {
2889 requestName [0] LDAPOID,
2890 requestValue [1] OCTET STRING OPTIONAL }
2892 ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
2893 COMPONENTS OF LDAPResult,
2894 responseName [10] LDAPOID OPTIONAL,
2896 Sermersheim Internet-Draft - Expires Aug 2004 Page 50
\f
2897 Lightweight Directory Access Protocol Version 3
2899 responseValue [11] OCTET STRING OPTIONAL }
2954 Sermersheim Internet-Draft - Expires Aug 2004 Page 51
\f
2955 Lightweight Directory Access Protocol Version 3
2957 Appendix C - Changes
2959 This appendix is non-normative.
2961 This appendix summarizes substantive changes made to RFC 2251 and RFC
2965 C.1 Changes made to made to RFC 2251:
2967 This section summarizes the substantive changes made to Sections 1,
2968 2, 3.1, and 4 through the remainder of RFC 2251. Readers should
2969 consult [Models] and [AuthMeth] for summaries of changes to other
2975 - Removed IESG note. Post publication of RFC 2251, mandatory LDAP
2976 authentication mechanisms have been standardized which are
2977 sufficient to remove this note. See [AuthMeth] for authentication
2981 C.1.2 Section 3.1 and others
2983 - Removed notes giving history between LDAP v1, v2 and v3. Instead,
2984 added sufficient language so that this document can stand on its
2990 - Clarified where the extensibility features of ASN.1 apply to the
2991 protocol. This change also affected various ASN.1 types.
2992 - Removed the requirement that servers which implement version 3 or
2993 later MUST provide the 'supportedLDAPVersion' attribute. This
2994 statement provided no interoperability advantages.
2999 - There was a mandatory requirement for the server to return a
3000 Notice of Disconnection and drop the connection when a PDU is
3001 malformed in a certain way. This has been clarified such that the
3002 server SHOULD return the Notice of Disconnection, and MUST drop
3006 C.1.5 Section 4.1.1.1
3008 - Clarified that the messageID of requests MUST be non-zero.
3012 Sermersheim Internet-Draft - Expires Aug 2004 Page 52
\f
3013 Lightweight Directory Access Protocol Version 3
3015 - Clarified when it is and isn't appropriate to return an already
3016 used message id. RFC 2251 accidentally imposed synchronous server
3017 behavior in its wording of this.
3022 - Stated that LDAPOID is constrained to <numericoid> from [Models].
3025 C.1.7 Section 4.1.5.1
3027 - Removed the Binary Option from the specification. There are
3028 numerous interoperability problems associated with this method of
3029 alternate attribute type encoding. Work to specify a suitable
3030 replacement is ongoing.
3035 - Removed references to the "binary" encoding as it has been removed
3036 from the specification.
3041 - Removed references to the "binary" encoding as it has been removed
3042 from the specification.
3045 C.1.10 Section 4.1.8
3047 - Combined the definitions of PartialAttribute and Attribute here,
3048 and defined Attribute in terms of PartialAttribute.
3051 C.1.11 Section 4.1.10
3053 - Renamed "errorMessage" to "diagnosticMessage" as it is allowed to
3054 be sent for non-error results.
3055 - Moved some language into Appendix A, and refer the reader there.
3056 - Allowed matchedDN to be present for other result codes than those
3060 C.1.12 Section 4.1.11
3062 - Defined referrals in terms of URIs rather than URLs.
3063 - Removed the requirement that all referral URIs MUST be equally
3064 capable of progressing the operation. The statement was ambiguous
3065 and provided no instructions on how to carry it out.
3066 - Added the requirement that clients MUST NOT loop between servers.
3067 - Clarified the instructions for using LDAPURLs in referrals, and in
3068 doing so added a recommendation that the scope part be present.
3070 Sermersheim Internet-Draft - Expires Aug 2004 Page 53
\f
3071 Lightweight Directory Access Protocol Version 3
3075 C.1.13 Section 4.1.12
3077 - Specified how control values defined in terms of ASN.1 are to be
3079 - Noted that the criticality field is only applied to request
3080 messages (except unbindRequest), and must be ignored when present
3081 on response messages and unbindRequest.
3082 - Added language regarding combinations of controls on a message.
3083 - Changed "The server MUST be prepared" to "Implementations MUST be
3084 prepared" in the eighth paragraph to reflect that both client and
3085 server implementations must be able to handle this (as both parse
3091 - Mandated that servers return protocolError when the version is not
3093 - Clarified behavior when the simple authentication is used, the
3094 name is empty and the password is non-empty.
3095 - Required servers to not dereference aliases for bind. This was
3096 added for consistency with other operations and to help ensure
3098 - Required that textual passwords be transferred as UTF-8 encoded
3099 Unicode, and added recommendations on string preparation. This was
3100 to help ensure interoperability of passwords being sent from
3104 C.1.15 Section 4.2.1
3106 - This section was largely reorganized for readability and language
3107 was added to clarify the authentication state of failed and
3108 abandoned bind operations.
3109 - Removed: "If a SASL transfer encryption or integrity mechanism has
3110 been negotiated, that mechanism does not support the changing of
3111 credentials from one identity to another, then the client MUST
3112 instead establish a new connection."
3113 Each SASL negotiation is, generally, independent of other SASL
3114 negotiations. If there were dependencies between multiple
3115 negotiations of a particular mechanism, the mechanism technical
3116 specification should detail how applications are to deal with
3117 them. LDAP should not require any special handling. And if an LDAP
3118 client had used such a mechanism, it would have the option of
3119 using another mechanism.
3120 - Dropped MUST imperative in paragraph 3 to align with [Keywords].
3123 C.1.16 Section 4.2.3
3128 Sermersheim Internet-Draft - Expires Aug 2004 Page 54
\f
3129 Lightweight Directory Access Protocol Version 3
3131 - Moved most error-related text to Appendix A, and added text
3132 regarding certain errors used in conjunction with the bind
3134 - Prohibited the server from specifying serverSaslCreds when not
3140 - Required both peers to cease transmission and close the connection
3141 for the unbind operation.
3146 - Added instructions for future specifications of Unsolicited
3150 C.1.19 Section 4.5.1
3152 - SearchRequest attributes is now defined as an AttributeSelection
3153 type rather than AttributeDescriptionList, and an ABNF is
3155 - SearchRequest attributes may contain duplicate attribute
3156 descriptions. This was previously prohibited. Now servers are
3157 instructed to ignore subsequent names when they are duplicated.
3158 This was relaxed in order to allow different short names and also
3159 OIDs to be requested for an attribute.
3160 - The Filter choices 'and' and 'or', and the SubstringFilter
3161 substrings types are now defined with a lower bound of 1.
3162 - The SubstringFilter substrings 'initial, 'any', and 'final' types
3163 are now AssertionValue rather than LDAPString. Also, added
3164 imperatives stating that 'initial' (if present) must be listed
3165 first, and 'final' (if present) must be listed last.
3166 - Clarified the semantics of the derefAliases choices.
3167 - Added instructions for equalityMatch, substrings, greaterOrEqual,
3168 lessOrEqual, and approxMatch.
3171 C.1.20 Section 4.5.2
3173 - Recommended that servers not use attribute short names when it
3174 knows they are ambiguous or may cause interoperability problems.
3175 - Removed all mention of ExtendedResponse due to lack of
3179 C.1.21 Section 4.5.3
3181 - Made changes similar to those made to Section 4.1.11.
3184 C.1.22 Section 4.5.3.1
3186 Sermersheim Internet-Draft - Expires Aug 2004 Page 55
\f
3187 Lightweight Directory Access Protocol Version 3
3190 - Fixed examples to adhere to changes made to Section 4.5.3.
3195 - Removed restriction that required an EQUALITY matching rule in
3196 order to perform value delete modifications. It is sufficiently
3197 documented that in absence of an equality matching rule, octet
3199 - Replaced AttributeTypeAndValues with Attribute as they are
3201 - Clarified what type of modification changes might temporarily
3207 - Aligned Add operation with X.511 in that the attributes of the RDN
3208 are used in conjunction with the listed attributes to create the
3209 entry. Previously, Add required that the distinguished values be
3210 present in the listed attributes.
3215 - Required servers to not dereference aliases for modify DN. This
3216 was added for consistency with other operations and to help ensure
3218 - Allow modify DN to fail when moving between naming contexts.
3219 - Specified what happens when the attributes of the newrdn are no
3220 present on the entry.
3225 - Clarified the semantics of Compare when the attribute is not
3226 present and when it is unknown.
3227 - Clarified that an Undefined compare results in a compareFalse
3229 - Required servers to not dereference aliases for compare. This was
3230 added for consistency with other operations and to help ensure
3236 - Explained that since abandon returns no response, clients should
3237 not use it if they need to know the outcome.
3238 - Specified that Abandon and Unbind cannot be abandoned.
3244 Sermersheim Internet-Draft - Expires Aug 2004 Page 56
\f
3245 Lightweight Directory Access Protocol Version 3
3247 - Specified how values of extended operations defined in terms of
3248 ASN.1 are to be encoded.
3249 - Added instructions on what extended operation specifications
3251 - Added a recommendation that servers advertise supported extended
3257 - Moved referral-specific instructions into referral-related
3263 - Reworded notes regarding SASL not protecting certain aspects of
3265 - Noted that Servers are encouraged to prevent directory
3266 modifications by clients that have authenticated anonymously
3268 - Added a note regarding the scenario where an identity is changed
3269 (deleted, privileges or credentials modified, etc.).
3270 - Warned against following referrals that may have been injected in
3272 - Noted that servers should protect information equally, whether in
3273 an error condition or not, and mentioned specifically; matchedDN,
3274 diagnosticMessage, and resultCodes.
3275 - Added a note regarding malformed and long encodings.
3280 - Added "EXTESIBILITY IMPLIED" to ASN.1 definition.
3281 - Removed AttributeType. It is not used.
3284 C.2 Changes made to made to RFC 2830:
3286 This section summarizes the substantive changes made to Sections of
3287 RFC 2830. Readers should consult [AuthMeth] for summaries of changes
3293 - Removed wording indicating that referrals can be returned from
3295 - Removed requirement that only a narrow set of result codes can be
3296 returned. Some result codes are required in certain scenarios, but
3297 any other may be returned if appropriate.
3300 C.2.1 Section 4.13.3.1
3302 Sermersheim Internet-Draft - Expires Aug 2004 Page 57
\f
3303 Lightweight Directory Access Protocol Version 3
3306 - Reworded most of this section and added the requirement that after
3307 the TLS connection has been closed, the server MUST NOT send
3308 responses to any request message received before the TLS closure.
3311 C.3 Changes made to made to [LIMR]:
3313 - In general, all technical language was transferred in whole.
3314 Supporting and background language seen as redundant due to its
3315 presence in this document was omitted.
3360 Sermersheim Internet-Draft - Expires Aug 2004 Page 58
\f
3361 Lightweight Directory Access Protocol Version 3
3363 Intellectual Property Rights
3365 The IETF takes no position regarding the validity or scope of any
3366 intellectual property or other rights that might be claimed to
3367 pertain to the implementation or use of the technology described in
3368 this document or the extent to which any license under such rights
3369 might or might not be available; neither does it represent that it
3370 has made any effort to identify any such rights. Information on the
3371 IETF's procedures with respect to rights in standards-track and
3372 standards-related documentation can be found in BCP-11. Copies of
3373 claims of rights made available for publication and any assurances of
3374 licenses to be made available, or the result of an attempt made to
3375 obtain a general license or permission for the use of such
3376 proprietary rights by implementors or users of this specification can
3377 be obtained from the IETF Secretariat.
3379 The IETF invites any interested party to bring to its attention any
3380 copyrights, patents or patent applications, or other proprietary
3381 rights which may cover technology that may be required to practice
3382 this standard. Please address the information to the IETF Executive
3386 Full Copyright Statement
3388 Copyright (C) The Internet Society (2003). All Rights Reserved.
3390 This document and translations of it may be copied and furnished to
3391 others, and derivative works that comment on or otherwise explain it
3392 or assist in its implementation may be prepared, copied, published
3393 and distributed, in whole or in part, without restriction of any
3394 kind, provided that the above copyright notice and this paragraph are
3395 included on all such copies and derivative works. However, this
3396 document itself may not be modified in any way, such as by removing
3397 the copyright notice or references to the Internet Society or other
3398 Internet organizations, except as needed for the purpose of
3399 developing Internet standards in which case the procedures for
3400 copyrights defined in the Internet Standards process must be
3401 followed, or as required to translate it into languages other than
3404 The limited permissions granted above are perpetual and will not be
3405 revoked by the Internet Society or its successors or assigns.
3407 This document and the information contained herein is provided on an
3408 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
3409 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
3410 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
3411 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
3412 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
3418 Sermersheim Internet-Draft - Expires Aug 2004 Page 59
\f