idnits 2.17.1 draft-ietf-ldapbis-protocol-20.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Looks like you're using RFC 2026 boilerplate. This must be updated to follow RFC 3978/3979, as updated by RFC 4748. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 1 instance of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. == The 'Obsoletes: ' line in the draft header should list only the _numbers_ of the RFCs which will be obsoleted by this document (if approved); it should not include the word 'RFC' in the list. -- The draft header indicates that this document obsoletes RFC2251, but the abstract doesn't seem to mention this, which it should. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the RFC 3978 Section 5.4 Copyright Line does not match the current year == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords -- however, there's a paragraph with a matching beginning. Boilerplate error? (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (Jan 2004) is 7399 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Looks like a reference, but probably isn't: '0' on line 2550 -- Looks like a reference, but probably isn't: '3' on line 2493 == Missing Reference: 'APPLICATION 0' is mentioned on line 2426, but not defined == Missing Reference: 'SASLprep' is mentioned on line 697, but not defined == Missing Reference: 'Stringprep' is mentioned on line 697, but not defined == Missing Reference: 'APPLICATION 1' is mentioned on line 2441, but not defined -- Looks like a reference, but probably isn't: '7' on line 2477 == Missing Reference: 'APPLICATION 2' is mentioned on line 2445, but not defined == Missing Reference: 'APPLICATION 3' is mentioned on line 2448, but not defined -- Looks like a reference, but probably isn't: '1' on line 2551 -- Looks like a reference, but probably isn't: '2' on line 2492 -- Looks like a reference, but probably isn't: '4' on line 2494 -- Looks like a reference, but probably isn't: '5' on line 2475 -- Looks like a reference, but probably isn't: '6' on line 2476 -- Looks like a reference, but probably isn't: '8' on line 2478 -- Looks like a reference, but probably isn't: '9' on line 2479 == Missing Reference: 'APPLICATION 4' is mentioned on line 2496, but not defined == Missing Reference: 'APPLICATION 19' is mentioned on line 2505, but not defined == Missing Reference: 'APPLICATION 5' is mentioned on line 2508, but not defined == Missing Reference: 'APPLICATION 6' is mentioned on line 2510, but not defined == Missing Reference: 'APPLICATION 7' is mentioned on line 2519, but not defined == Missing Reference: 'APPLICATION 8' is mentioned on line 2521, but not defined == Missing Reference: 'APPLICATION 9' is mentioned on line 2527, but not defined == Missing Reference: 'APPLICATION 10' is mentioned on line 2529, but not defined == Missing Reference: 'APPLICATION 11' is mentioned on line 2531, but not defined == Missing Reference: 'APPLICATION 12' is mentioned on line 2533, but not defined == Missing Reference: 'APPLICATION 13' is mentioned on line 2539, but not defined == Missing Reference: 'APPLICATION 14' is mentioned on line 2541, but not defined == Missing Reference: 'APPLICATION 15' is mentioned on line 2545, but not defined == Missing Reference: 'APPLICATION 16' is mentioned on line 2547, but not defined == Missing Reference: 'APPLICATION 23' is mentioned on line 2549, but not defined == Missing Reference: 'APPLICATION 24' is mentioned on line 2553, but not defined -- Looks like a reference, but probably isn't: '10' on line 2555 -- Looks like a reference, but probably isn't: '11' on line 2556 == Missing Reference: 'Keywords' is mentioned on line 2703, but not defined == Unused Reference: 'IP' is defined on line 1960, but no explicit reference was found in the text == Unused Reference: 'SASLPrep' is defined on line 1989, but no explicit reference was found in the text == Unused Reference: 'StringPrep' is defined on line 1993, but no explicit reference was found in the text ** Obsolete normative reference: RFC 2234 (ref. 'ABNF') (Obsoleted by RFC 4234) -- No information found for draft-ietf-ldapbis-authmeth-xx - is the name correct? -- Possible downref: Normative reference to a draft: ref. 'AuthMeth' -- Possible downref: Non-RFC (?) normative reference: ref. 'BER' -- Possible downref: Non-RFC (?) normative reference: ref. 'ISO10646' -- No information found for draft-ietf-ldapbis-dn-xx - is the name correct? -- Possible downref: Normative reference to a draft: ref. 'LDAPDN' -- No information found for draft-ietf-ldapbis-bcp64-xx - is the name correct? -- Possible downref: Normative reference to a draft: ref. 'LDAPIANA' -- No information found for draft-ietf-ldapbis-url-xx - is the name correct? -- Possible downref: Normative reference to a draft: ref. 'LDAPURL' -- No information found for draft-ietf-ldapbis-models-xx - is the name correct? -- Possible downref: Normative reference to a draft: ref. 'Models' -- No information found for draft-ietf-ldapbis-roadmap-xx - is the name correct? -- Possible downref: Normative reference to a draft: ref. 'Roadmap' -- No information found for draft-ietf-sasl-rfc2222bis-xx - is the name correct? -- Possible downref: Normative reference to a draft: ref. 'SASL' -- No information found for draft-ietf-sasl-saslprep-xx - is the name correct? -- Possible downref: Normative reference to a draft: ref. 'SASLPrep' -- No information found for draft-hoffman-rfc3454bis-xx - is the name correct? -- Possible downref: Normative reference to a draft: ref. 'StringPrep' -- No information found for draft-ietf-ldapbis-syntaxes-xx - is the name correct? -- Possible downref: Normative reference to a draft: ref. 'Syntaxes' ** Obsolete normative reference: RFC 793 (ref. 'TCP') (Obsoleted by RFC 9293) -- No information found for draft-ietf-tls-rfc2246-bis-xx - is the name correct? -- Possible downref: Normative reference to a draft: ref. 'TLS' -- Possible downref: Non-RFC (?) normative reference: ref. 'Unicode' ** Obsolete normative reference: RFC 2396 (ref. 'URI') (Obsoleted by RFC 3986) Summary: 4 errors (**), 0 flaws (~~), 30 warnings (==), 40 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 Internet-Draft Editor: J. Sermersheim 2 Intended Category: Standard Track Novell, Inc 3 Document: draft-ietf-ldapbis-protocol-20.txt Jan 2004 4 Obsoletes: RFC 2251, 2830 6 LDAP: The Protocol 8 Status of this Memo 10 This document is an Internet-Draft and is in full conformance with 11 all provisions of Section 10 of RFC2026. 13 Internet-Drafts are working documents of the Internet Engineering 14 Task Force (IETF), its areas, and its working groups. Note that other 15 groups may also distribute working documents as Internet-Drafts. 16 Internet-Drafts are draft documents valid for a maximum of six months 17 and may be updated, replaced, or obsoleted by other documents at any 18 time. It is inappropriate to use Internet-Drafts as reference 19 material or to cite them other than as "work in progress." 21 The list of current Internet-Drafts can be accessed at 22 http://www.ietf.org/ietf/1id-abstracts.txt 24 The list of Internet-Draft Shadow Directories can be accessed at 25 http://www.ietf.org/shadow.html. 27 Distribution of this memo is unlimited. Technical discussion of this 28 document will take place on the IETF LDAP Revision Working Group 29 (LDAPbis) mailing list . Please send 30 editorial comments directly to the editor . 32 Abstract 34 This document describes the protocol elements, along with their 35 semantics and encodings, of the Lightweight Directory Access Protocol 36 (LDAP). LDAP provides access to distributed directory services that 37 act in accordance with X.500 data and service models. These protocol 38 elements are based on those described in the X.500 Directory Access 39 Protocol (DAP). 41 Table of Contents 43 1. Introduction....................................................2 44 1.1. Relationship to Obsolete Specifications.......................3 45 2. Conventions.....................................................3 46 3. Protocol Model..................................................3 47 4. Elements of Protocol............................................4 48 4.1. Common Elements...............................................4 49 4.1.1. Message Envelope............................................4 50 4.1.2. String Types................................................6 51 Lightweight Directory Access Protocol Version 3 53 4.1.3. Distinguished Name and Relative Distinguished Name..........6 54 4.1.4. Attribute Descriptions......................................7 55 4.1.5. Attribute Value.............................................7 56 4.1.6. Attribute Value Assertion...................................7 57 4.1.7. Attribute and PartialAttribute..............................8 58 4.1.8. Matching Rule Identifier....................................8 59 4.1.9. Result Message..............................................8 60 4.1.10. Referral..................................................10 61 4.1.11. Controls..................................................11 62 4.2. Bind Operation...............................................12 63 4.3. Unbind Operation.............................................15 64 4.4. Unsolicited Notification.....................................15 65 4.5. Search Operation.............................................17 66 4.6. Modify Operation.............................................25 67 4.7. Add Operation................................................27 68 4.8. Delete Operation.............................................28 69 4.9. Modify DN Operation..........................................28 70 4.10. Compare Operation...........................................29 71 4.11. Abandon Operation...........................................30 72 4.12. Extended Operation..........................................31 73 4.13. StartTLS Operation..........................................32 74 5. Protocol Element Encodings and Transfer........................34 75 5.1. Protocol Encoding............................................34 76 5.2. Transfer Protocols...........................................35 77 6. Security Considerations........................................35 78 7. Acknowledgements...............................................36 79 8. Normative References...........................................36 80 9. Informative References.........................................38 81 10. IANA Considerations...........................................38 82 11. Editor's Address..............................................38 83 Appendix A - LDAP Result Codes....................................39 84 A.1 Non-Error Result Codes........................................39 85 A.2 Result Codes..................................................39 86 Appendix B - Complete ASN.1 Definition............................43 87 Appendix C - Changes..............................................49 88 C.1 Changes made to made to RFC 2251:.............................49 89 C.2 Changes made to made to RFC 2830:.............................54 91 1. Introduction 93 The Directory is "a collection of open systems cooperating to provide 94 directory services" [X.500]. A directory user, which may be a human 95 or other entity, accesses the Directory through a client (or 96 Directory User Agent (DUA)). The client, on behalf of the directory 97 user, interacts with one or more servers (or Directory System Agents 98 (DSA)). Clients interact with servers using a directory access 99 protocol. 101 This document details the protocol elements of the Lightweight 102 Directory Access Protocol (LDAP), along with their semantics. 103 Following the description of protocol elements, it describes the way 104 in which the protocol elements are encoded and transferred. 106 Lightweight Directory Access Protocol Version 3 108 1.1. Relationship to Obsolete Specifications 110 This document is an integral part of the LDAP Technical Specification 111 [Roadmap] which obsoletes the previously defined LDAP technical 112 specification, RFC 3377, in its entirety. 114 This document obsoletes all of RFC 2251 except the following: 115 Sections 3.2, 3.4, 4.1.3 (last paragraph), 4.1.4, 4.1.5, 4.1.5.1, 116 4.1.9 (last paragraph), 5.1, 6.1, and 6.2 (last paragraph) are 117 obsoleted by [Models]. 118 Section 3.3 is obsoleted by [Roadmap]. 119 Sections 4.2.1 (portions), and 4.2.2 are obsoleted by [AuthMeth]. 121 Appendix C.1 summarizes substantive changes to the remaining 122 sections. 124 This document also obsoletes RFC 2830, Sections 2 and 4 in entirety. 125 The remainder of RFC 2830 is obsoleted by [AuthMeth]. Appendix C.2 126 summarizes substantive changes to the remaining sections. 128 2. Conventions 130 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 131 "SHOULD", "SHOULD NOT", "RECOMMENDED", and "MAY" in this document are 132 to be interpreted as described in [Keyword]. 134 The terms "connection" and "LDAP connection" both refer to the 135 underlying transport protocol connection between two protocol peers. 137 The term "TLS connection" refers to a [TLS]-protected LDAP 138 connection. 140 The terms "association" and "LDAP association" both refer to the 141 association of the LDAP connection and its current authentication and 142 authorization state. 144 3. Protocol Model 146 The general model adopted by this protocol is one of clients 147 performing protocol operations against servers. In this model, a 148 client transmits a protocol request describing the operation to be 149 performed to a server. The server is then responsible for performing 150 the necessary operation(s) in the Directory. Upon completion of an 151 operation, the server typically returns a response containing 152 appropriate data to the requesting client. 154 Although servers are required to return responses whenever such 155 responses are defined in the protocol, there is no requirement for 156 synchronous behavior on the part of either clients or servers. 157 Requests and responses for multiple operations generally may be 158 exchanged between a client and server in any order, provided the 159 Lightweight Directory Access Protocol Version 3 161 client eventually receives a response for every request that requires 162 one. 164 The core protocol operations defined in this document can be mapped 165 to a subset of the X.500 (1993) Directory Abstract Service [X.511]. 166 However there is not a one-to-one mapping between LDAP operations and 167 X.500 Directory Access Protocol (DAP) operations. Server 168 implementations acting as a gateway to X.500 directories may need to 169 make multiple DAP requests to service a single LDAP request. 171 4. Elements of Protocol 173 The protocol is described using Abstract Syntax Notation One 174 ([ASN.1]), and is transferred using a subset of ASN.1 Basic Encoding 175 Rules ([BER]). Section 5.1 specifies how the protocol elements are 176 encoded and transferred. 178 In order to support future extensions to this protocol, extensibility 179 is implied where it is allowed (per ASN.1). In addition, ellipses 180 (...) have been supplied in ASN.1 types that are explicitly 181 extensible as discussed in [LDAPIANA]. Because of the implied 182 extensibility, clients and servers MUST (unless otherwise specified) 183 ignore trailing SEQUENCE components whose tags they do not recognize. 185 Changes to the protocol other than through the extension mechanisms 186 described here require a different version number. A client indicates 187 the version it is using as part of the bind request, described in 188 Section 4.2. If a client has not sent a bind, the server MUST assume 189 the client is using version 3 or later. 191 Clients may determine the protocol versions a server supports by 192 reading the 'supportedLDAPVersion' attribute from the root DSE (DSA- 193 Specific Entry) [Models]. 195 4.1. Common Elements 197 This section describes the LDAPMessage envelope Protocol Data Unit 198 (PDU) format, as well as data type definitions, which are used in the 199 protocol operations. 201 4.1.1. Message Envelope 203 For the purposes of protocol exchanges, all protocol operations are 204 encapsulated in a common envelope, the LDAPMessage, which is defined 205 as follows: 207 LDAPMessage ::= SEQUENCE { 208 messageID MessageID, 209 protocolOp CHOICE { 210 bindRequest BindRequest, 211 bindResponse BindResponse, 212 Lightweight Directory Access Protocol Version 3 214 unbindRequest UnbindRequest, 215 searchRequest SearchRequest, 216 searchResEntry SearchResultEntry, 217 searchResDone SearchResultDone, 218 searchResRef SearchResultReference, 219 modifyRequest ModifyRequest, 220 modifyResponse ModifyResponse, 221 addRequest AddRequest, 222 addResponse AddResponse, 223 delRequest DelRequest, 224 delResponse DelResponse, 225 modDNRequest ModifyDNRequest, 226 modDNResponse ModifyDNResponse, 227 compareRequest CompareRequest, 228 compareResponse CompareResponse, 229 abandonRequest AbandonRequest, 230 extendedReq ExtendedRequest, 231 extendedResp ExtendedResponse, 232 ... }, 233 controls [0] Controls OPTIONAL } 235 MessageID ::= INTEGER (0 .. maxInt) 237 maxInt INTEGER ::= 2147483647 -- (2^^31 - 1) -- 239 The ASN.1 type Controls is defined in Section 4.1.11. 241 The function of the LDAPMessage is to provide an envelope containing 242 common fields required in all protocol exchanges. At this time the 243 only common fields are the message ID and the controls. 245 If the server receives a PDU from the client in which the LDAPMessage 246 SEQUENCE tag cannot be recognized, the messageID cannot be parsed, 247 the tag of the protocolOp is not recognized as a request, or the 248 encoding structures or lengths of data fields are found to be 249 incorrect, then the server SHOULD return the Notice of Disconnection 250 described in Section 4.4.1, with the resultCode set to protocolError, 251 and MUST immediately close the connection. 253 In other cases where the client or server cannot parse a PDU, it 254 SHOULD abruptly close the connection where further communication 255 (including providing notice) would be pernicious. Otherwise, server 256 implementations MUST return an appropriate response to the request, 257 with the resultCode set to protocolError. 259 4.1.1.1. Message ID 261 All LDAPMessage envelopes encapsulating responses contain the 262 messageID value of the corresponding request LDAPMessage. 264 The message ID of a request MUST have a non-zero value different from 265 the values of any other requests outstanding in the LDAP association 266 Lightweight Directory Access Protocol Version 3 268 of which this message is a part. The zero value is reserved for the 269 unsolicited notification message. 271 Typical clients increment a counter for each request. 273 A client MUST NOT send a request with the same message ID as an 274 earlier request on the same LDAP association unless it can be 275 determined that the server is no longer servicing the earlier request 276 (e.g. after the final response is received, or a subsequent bind 277 completes). Otherwise the behavior is undefined. For this purpose, 278 note that abandon and abandoned operations do not send responses. 280 4.1.2. String Types 282 The LDAPString is a notational convenience to indicate that, although 283 strings of LDAPString type encode as ASN.1 OCTET STRING types, the 284 [ISO10646] character set (a superset of [Unicode]) is used, encoded 285 following the [UTF-8] algorithm. Note that Unicode characters U+0000 286 through U+007F are the same as ASCII 0 through 127, respectively, and 287 have the same single octet UTF-8 encoding. Other Unicode characters 288 have a multiple octet UTF-8 encoding. 290 LDAPString ::= OCTET STRING -- UTF-8 encoded, 291 -- [ISO10646] characters 293 The LDAPOID is a notational convenience to indicate that the 294 permitted value of this string is a (UTF-8 encoded) dotted-decimal 295 representation of an OBJECT IDENTIFIER. Although an LDAPOID is 296 encoded as an OCTET STRING, values are limited to the definition of 297 given in Section 1.4 of [Models]. 299 LDAPOID ::= OCTET STRING -- Constrained to [Models] 301 For example, 303 1.3.6.1.4.1.1466.1.2.3 305 4.1.3. Distinguished Name and Relative Distinguished Name 307 An LDAPDN is defined to be the representation of a Distinguished Name 308 (DN) after encoding according to the specification in [LDAPDN]. 310 LDAPDN ::= LDAPString 311 -- Constrained to [LDAPDN] 313 A RelativeLDAPDN is defined to be the representation of a Relative 314 Distinguished Name (RDN) after encoding according to the 315 specification in [LDAPDN]. 317 RelativeLDAPDN ::= LDAPString 318 -- Constrained to [LDAPDN] 319 Lightweight Directory Access Protocol Version 3 321 4.1.4. Attribute Descriptions 323 The definition and encoding rules for attribute descriptions are 324 defined in Section 2.5 of [Models]. Briefly, an attribute description 325 is an attribute type and zero or more options. 327 AttributeDescription ::= LDAPString 328 -- Constrained to 329 -- [Models] 331 4.1.5. Attribute Value 333 A field of type AttributeValue is an OCTET STRING containing an 334 encoded attribute value. The attribute value is encoded according to 335 the LDAP-specific encoding definition of its corresponding syntax. 336 The LDAP-specific encoding definitions for different syntaxes and 337 attribute types may be found in other documents and in particular 338 [Syntaxes]. 340 AttributeValue ::= OCTET STRING 342 Note that there is no defined limit on the size of this encoding; 343 thus protocol values may include multi-megabyte attribute values 344 (e.g. photographs). 346 Attribute values may be defined which have arbitrary and non- 347 printable syntax. Implementations MUST NOT display nor attempt to 348 decode an attribute value if its syntax is not known. The 349 implementation may attempt to discover the subschema of the source 350 entry, and retrieve the descriptions of 'attributeTypes' from it 351 [Models]. 353 Clients MUST only send attribute values in a request that are valid 354 according to the syntax defined for the attributes. 356 4.1.6. Attribute Value Assertion 358 The AttributeValueAssertion (AVA) type definition is similar to the 359 one in the X.500 Directory standards. It contains an attribute 360 description and a matching rule ([Models Section 4.1.3) assertion 361 value suitable for that type. Elements of this type are typically 362 used to assert that the value in assertionValue matches a value of an 363 attribute. 365 AttributeValueAssertion ::= SEQUENCE { 366 attributeDesc AttributeDescription, 367 assertionValue AssertionValue } 369 AssertionValue ::= OCTET STRING 370 Lightweight Directory Access Protocol Version 3 372 The syntax of the AssertionValue depends on the context of the LDAP 373 operation being performed. For example, the syntax of the EQUALITY 374 matching rule for an attribute is used when performing a Compare 375 operation. Often this is the same syntax used for values of the 376 attribute type, but in some cases the assertion syntax differs from 377 the value syntax. See objectIdentiferFirstComponentMatch in 378 [Syntaxes] for an example. 380 4.1.7. Attribute and PartialAttribute 382 Attributes and partial attributes consist of an attribute description 383 and attribute values. A PartialAttribute allows zero values, while 384 Attribute requires at least one value. 386 PartialAttribute ::= SEQUENCE { 387 type AttributeDescription, 388 vals SET OF value AttributeValue } 390 Attribute ::= PartialAttribute(WITH COMPONENTS { 391 ..., 392 vals (SIZE(1..MAX))}) 394 No two attribute values are equivalent as described by Section 2.3 of 395 [Models]. The set of attribute values is unordered. Implementations 396 MUST NOT rely upon the ordering being repeatable. 398 4.1.8. Matching Rule Identifier 400 Matching rules are defined in Section 4.1.3 of [Models]. A matching 401 rule is identified in the protocol by the printable representation of 402 either its , or one of its short name descriptors 403 [Models], e.g. 'caseIgnoreMatch' or '2.5.13.2'. 405 MatchingRuleId ::= LDAPString 407 4.1.9. Result Message 409 The LDAPResult is the construct used in this protocol to return 410 success or failure indications from servers to clients. To various 411 requests, servers will return responses of LDAPResult or responses 412 containing the components of LDAPResult to indicate the final status 413 of a protocol operation request. 415 LDAPResult ::= SEQUENCE { 416 resultCode ENUMERATED { 417 success (0), 418 operationsError (1), 419 protocolError (2), 420 timeLimitExceeded (3), 421 sizeLimitExceeded (4), 422 compareFalse (5), 423 compareTrue (6), 424 Lightweight Directory Access Protocol Version 3 426 authMethodNotSupported (7), 427 strongAuthRequired (8), 428 -- 9 reserved -- 429 referral (10), 430 adminLimitExceeded (11), 431 unavailableCriticalExtension (12), 432 confidentialityRequired (13), 433 saslBindInProgress (14), 434 noSuchAttribute (16), 435 undefinedAttributeType (17), 436 inappropriateMatching (18), 437 constraintViolation (19), 438 attributeOrValueExists (20), 439 invalidAttributeSyntax (21), 440 -- 22-31 unused -- 441 noSuchObject (32), 442 aliasProblem (33), 443 invalidDNSyntax (34), 444 -- 35 reserved for undefined isLeaf -- 445 aliasDereferencingProblem (36), 446 -- 37-47 unused -- 447 inappropriateAuthentication (48), 448 invalidCredentials (49), 449 insufficientAccessRights (50), 450 busy (51), 451 unavailable (52), 452 unwillingToPerform (53), 453 loopDetect (54), 454 -- 55-63 unused -- 455 namingViolation (64), 456 objectClassViolation (65), 457 notAllowedOnNonLeaf (66), 458 notAllowedOnRDN (67), 459 entryAlreadyExists (68), 460 objectClassModsProhibited (69), 461 -- 70 reserved for CLDAP -- 462 affectsMultipleDSAs (71), 463 -- 72-79 unused -- 464 other (80), 465 ... }, 466 matchedDN LDAPDN, 467 diagnosticMessage LDAPString, 468 referral [3] Referral OPTIONAL } 470 The resultCode enumeration is extensible as defined in Section 3.6 of 471 [LDAPIANA]. The meanings of the listed result codes are given in 472 Appendix A. If a server detects multiple errors for an operation, 473 only one result code is returned. The server should return the result 474 code that best indicates the nature of the error encountered. 476 The diagnosticMessage field of this construct may, at the server's 477 option, be used to return a string containing a textual, human- 478 readable (terminal control and page formatting characters should be 479 avoided) diagnostic message. As this diagnostic message is not 480 Lightweight Directory Access Protocol Version 3 482 standardized, implementations MUST NOT rely on the values returned. 483 If the server chooses not to return a textual diagnostic, the 484 diagnosticMessage field MUST be empty. 486 For certain result codes (typically, but not restricted to 487 noSuchObject, aliasProblem, invalidDNSyntax and 488 aliasDereferencingProblem), the matchedDN field is set to the name of 489 the lowest entry (object or alias) in the Directory that was matched. 490 If no aliases were dereferenced while attempting to locate the entry, 491 this will be a truncated form of the name provided, or if aliases 492 were dereferenced, of the resulting name, as defined in Section 12.5 493 of [X.511]. Otherwise the matchedDN field is empty. 495 4.1.10. Referral 497 The referral result code indicates that the contacted server does not 498 hold the target entry of the request. The referral field is present 499 in an LDAPResult if the resultCode field value is referral, and 500 absent with all other result codes. It contains one or more 501 references to one or more servers or services that may be accessed 502 via LDAP or other protocols. Referrals can be returned in response to 503 any operation request (except unbind and abandon which do not have 504 responses). At least one URI MUST be present in the Referral. 506 During a search operation, after the baseObject is located, and 507 entries are being evaluated, the referral is not returned. Instead, 508 continuation references, described in Section 4.5.3, are returned 509 when other servers would need to be contacted to complete the 510 operation. 512 Referral ::= SEQUENCE SIZE (1..MAX) OF uri URI 514 URI ::= LDAPString -- limited to characters permitted in 515 -- URIs 517 If the client wishes to progress the operation, it MUST follow the 518 referral by contacting one of the supported services. If multiple 519 URIs are present, the client assumes that any supported URI may be 520 used to progress the operation. 522 Clients that follow referrals MUST ensure that they do not loop 523 between servers. They MUST NOT repeatedly contact the same server for 524 the same request with the same target entry name, scope and filter. 525 Some clients use a counter that is incremented each time referral 526 handling occurs for an operation, and these kinds of clients MUST be 527 able to handle at least ten nested referrals between the root and a 528 leaf entry. 530 A URI for a server implementing LDAP and accessible via [TCP]/[IP] 531 (v4 or v6) is written as an LDAP URL according to [LDAPURL]. 533 When an LDAP URL is used, the following instructions are followed: 535 Lightweight Directory Access Protocol Version 3 537 - If an alias was dereferenced, the part of the URL MUST be 538 present, with the new target object name. UTF-8 encoded characters 539 appearing in the string representation of a DN or search filter 540 may not be legal for URLs (e.g. spaces) and MUST be escaped using 541 the % method in [URI]. 542 - It is RECOMMENDED that the part be present to avoid 543 ambiguity. 544 - If the part is present, the client MUST use this name in its 545 next request to progress the operation, and if it is not present 546 the client will use the same name as in the original request. 547 - Some servers (e.g. participating in distributed indexing) may 548 provide a different filter in a URL of a referral for a search 549 operation. 550 - If the part of the LDAP URL is present, the client MUST 551 use this filter in its next request to progress this search, and 552 if it is not present the client MUST use the same filter as it 553 used for that search. 554 - For search, it is RECOMMENDED that the part be present to 555 avoid ambiguity. 556 - If the part is missing, the scope of the original search 557 is used by the client to progress the operation. 558 - Other aspects of the new request may be the same as or different 559 from the request which generated the referral. 561 Other kinds of URIs may be returned. The syntax and semantics of such 562 URIs is left to future specifications. Clients may ignore URIs that 563 they do not support. 565 4.1.11. Controls 567 A control is a way to specify extension information for an LDAP 568 message. A control only alters the semantics of the message it is 569 attached to. 571 Controls ::= SEQUENCE OF control Control 573 Control ::= SEQUENCE { 574 controlType LDAPOID, 575 criticality BOOLEAN DEFAULT FALSE, 576 controlValue OCTET STRING OPTIONAL } 578 The controlType field is the UTF-8 encoded dotted-decimal 579 representation of an OBJECT IDENTIFIER which uniquely identifies the 580 control, or the request control and its paired response control. This 581 prevents conflicts between control names. 583 The criticality field is either TRUE or FALSE and only applies to 584 request messages (except unbindRequest). For response messages and 585 unbindRequest, the criticality field SHOULD be FALSE, and is ignored 586 by the receiving protocol peer. 588 Lightweight Directory Access Protocol Version 3 590 If the server recognizes the control type and it is appropriate for 591 the operation, the server will make use of the control when 592 performing the operation. 594 If the server does not recognize the control type or it is not 595 appropriate for the operation, and the criticality field is TRUE, the 596 server MUST NOT perform the operation, and for operations that have a 597 response, MUST return unavailableCriticalExtension in the resultCode. 599 If the control is unrecognized or inappropriate but the criticality 600 field is FALSE, the server MUST ignore the control. 602 The controlValue contains any information associated with the 603 control. Its format is defined by the specification of the control. 604 Implementations MUST be prepared to handle arbitrary contents of the 605 controlValue octet string, including zero bytes. It is absent only if 606 there is no value information which is associated with a control of 607 its type. controlValues that are defined in terms of ASN.1 and BER 608 encoded according to Section 5.1, also follow the extensibility rules 609 in Section 4. 611 Servers list the controlType of all request controls they recognize 612 in the supportedControl attribute in the root DSE (Section 5.1 of 613 [Models]). 615 Controls SHOULD NOT be combined unless the semantics of the 616 combination has been specified. The semantics of control 617 combinations, if specified, are generally found in the control 618 specification most recently published. In the absence of combination 619 semantics, the behavior of the operation is undefined. 620 Additionally, unless order-dependent semantics are given in a 621 specification, the order of a combination of controls in the SEQUENCE 622 is ignored. 624 This document does not specify any controls. Controls may be 625 specified in other documents. The specification of a control consists 626 of: 628 - the OBJECT IDENTIFIER assigned to the control, 630 - whether the criticality field should be always set to TRUE, always 631 set to FALSE, or sender's choice, and server behavior when 632 constraints of this nature are violated, 634 - whether there is information associated with the control, and if 635 so, the format of the controlValue contents, 637 - the semantics of the control, and 639 - optionally, semantics regarding the combination of the control 640 with other controls. 642 4.2. Bind Operation 643 Lightweight Directory Access Protocol Version 3 645 The function of the Bind Operation is to allow authentication 646 information to be exchanged between the client and server. The Bind 647 operation should be thought of as the "authenticate" operation. 648 Authentication and security-related semantics of this operation are 649 given in [AuthMeth]. 651 The Bind Request is defined as follows: 653 BindRequest ::= [APPLICATION 0] SEQUENCE { 654 version INTEGER (1 .. 127), 655 name LDAPDN, 656 authentication AuthenticationChoice } 658 AuthenticationChoice ::= CHOICE { 659 simple [0] OCTET STRING, 660 -- 1 and 2 reserved 661 sasl [3] SaslCredentials, 662 ... } 664 SaslCredentials ::= SEQUENCE { 665 mechanism LDAPString, 666 credentials OCTET STRING OPTIONAL } 668 Fields of the Bind Request are: 670 - version: A version number indicating the version of the protocol 671 to be used in this LDAP association. This document describes 672 version 3 of the protocol. There is no version negotiation. The 673 client sets this field to the version it desires. If the server 674 does not support the specified version, it MUST respond with 675 protocolError in the resultCode field of the BindResponse. 677 - name: The name of the Directory object that the client wishes to 678 bind as. This field may take on a null value (a zero length 679 string) for the purposes of anonymous binds ([AuthMeth] Section 680 5.1) or when using Simple Authentication and Security Layer [SASL] 681 authentication ([AuthMeth] Section 3.3.2). Server behavior is 682 undefined when the name is a null value, simple authentication is 683 used, and a non-null password is specified. Where the server 684 attempts to locate the named object, it SHALL NOT perform alias 685 dereferencing. 687 - authentication: information used in authentication. This type is 688 extensible as defined in Section 3.7 of [LDAPIANA]. Servers that 689 do not support a choice supplied by a client return 690 authMethodNotSupported in the resultCode field of the 691 BindResponse. 693 Textual passwords (consisting of a character sequence with a known 694 character set and encoding) transferred to the server using the 695 simple AuthenticationChoice SHALL be transferred as [UTF-8] 696 encoded [Unicode]. Prior to transfer, clients SHOULD prepare text 697 passwords by applying the [SASLprep] profile of the [Stringprep] 698 Lightweight Directory Access Protocol Version 3 700 algorithm. Passwords consisting of other data (such as random 701 octets) MUST NOT be altered. The determination of whether a 702 password is textual is a local client matter. 704 Authorization is the use of this authentication information when 705 performing operations. Authorization MAY be affected by factors 706 outside of the LDAP Bind Request, such as those provided by lower 707 layer security services. 709 4.2.1. Processing of the Bind Request 711 Before processing a BindRequest, all outstanding operations MUST 712 either complete or be abandoned. The server may either wait for the 713 outstanding operations to complete, or abandon them. The server then 714 proceeds to authenticate the client in either a single-step, or 715 multi-step bind process. Each step requires the server to return a 716 BindResponse to indicate the status of authentication. 718 If the client did not bind before sending a request and receives an 719 operationsError to that request, it may then send a Bind Request. If 720 this also fails or the client chooses not to bind on the existing 721 connection, it may close the connection, reopen it and begin again by 722 first sending a PDU with a Bind Request. This will aid in 723 interoperating with servers implementing other versions of LDAP. 725 Clients may send multiple Bind Requests on a connection to change the 726 authentication and/or security associations or to complete a multi- 727 stage bind process. Authentication from earlier binds is subsequently 728 ignored. 730 For some SASL authentication mechanisms, it may be necessary for the 731 client to invoke the BindRequest multiple times. This is indicated by 732 the server sending a BindResponse with the resultCode set to 733 saslBindInProgress. This indicates that the server requires the 734 client to send a new bind request, with the same sasl mechanism, to 735 continue the authentication process. Clients MUST NOT invoke 736 operations between two Bind Requests made as part of a multi-stage 737 bind. 739 A client may abort a SASL bind negotiation by sending a BindRequest 740 with a different value in the mechanism field of SaslCredentials, or 741 an AuthenticationChoice other than sasl. 743 If the client sends a BindRequest with the sasl mechanism field as an 744 empty string, the server MUST return a BindResponse with 745 authMethodNotSupported as the resultCode. This will allow clients to 746 abort a negotiation if it wishes to try again with the same SASL 747 mechanism. 749 A failed Bind Operation has the effect of placing the connection in 750 an anonymous state. 752 4.2.2. Bind Response 753 Lightweight Directory Access Protocol Version 3 755 The Bind Response is defined as follows. 757 BindResponse ::= [APPLICATION 1] SEQUENCE { 758 COMPONENTS OF LDAPResult, 759 serverSaslCreds [7] OCTET STRING OPTIONAL } 761 BindResponse consists simply of an indication from the server of the 762 status of the client's request for authentication. 764 A successful bind operation is indicated by a BindResponse with a 765 resultCode set to success. Otherwise, an appropriate result code is 766 set in the BindResponse. For bind, the protocolError result code may 767 be used to indicate that the version number supplied by the client is 768 unsupported. 770 If the client receives a BindResponse where the resultCode field is 771 protocolError, it is to assume that the server does not support this 772 version of LDAP. While the client may be able proceed with another 773 version of this protocol (this may or may not require establishing a 774 new connection), how to proceed with another version of this protocol 775 is beyond the scope of this document. Clients which are unable or 776 unwilling to proceed SHOULD drop the underlying connection. 778 The serverSaslCreds field is used as part of a SASL-defined bind 779 mechanism to allow the client to authenticate the server to which it 780 is communicating, or to perform "challenge-response" authentication. 781 If the client bound with the simple choice, or the SASL mechanism 782 does not require the server to return information to the client, then 783 this field SHALL NOT be included in the BindResponse. 785 4.3. Unbind Operation 787 The function of the Unbind Operation is to terminate an LDAP 788 association and connection. The Unbind operation is not the 789 antithesis of the Bind operation as the name implies. The naming of 790 these operations is historical. The Unbind operation should be 791 thought of as the "quit" operation. 793 The Unbind Operation is defined as follows: 795 UnbindRequest ::= [APPLICATION 2] NULL 797 The Unbind Operation has no response defined. Upon transmission of 798 the UnbindRequest, each protocol peer is to consider the LDAP 799 association terminated, MUST cease transmission of messages to the 800 other peer, and MUST close the connection. Outstanding operations are 801 handled as specified in Section 5.2. 803 4.4. Unsolicited Notification 804 Lightweight Directory Access Protocol Version 3 806 An unsolicited notification is an LDAPMessage sent from the server to 807 the client which is not in response to any LDAPMessage received by 808 the server. It is used to signal an extraordinary condition in the 809 server or in the connection between the client and the server. The 810 notification is of an advisory nature, and the server will not expect 811 any response to be returned from the client. 813 The unsolicited notification is structured as an LDAPMessage in which 814 the messageID is zero and protocolOp is of the extendedResp form (See 815 Section 4.12). The responseName field of the ExtendedResponse always 816 contains an LDAPOID which is unique for this notification. 818 One unsolicited notification (Notice of Disconnection) is defined in 819 this document. The specification of an unsolicited notification 820 consists of: 822 - the OBJECT IDENTIFIER assigned to the notification (to be 823 specified in the responseName, 825 - the format of the contents (if any) of the responseValue, 827 - the circumstances which will cause the notification to be 828 returned, and 830 - the semantics of the operation. 832 4.4.1. Notice of Disconnection 834 This notification may be used by the server to advise the client that 835 the server is about to close the connection due to an error 836 condition. This notification is intended to assist clients in 837 distinguishing between an error condition and a transient network 838 failure. Note that this notification is not a response to an unbind 839 requested by the client. Outstanding operations are handled as 840 specified in Section 5.2. 842 The responseName is 1.3.6.1.4.1.1466.20036, the response field is 843 absent, and the resultCode is used to indicate the reason for the 844 disconnection. 846 The following result codes have these meanings when used in this 847 notification: 849 - protocolError: The server has received data from the client in 850 which the LDAPMessage structure could not be parsed. 852 - strongAuthRequired: The server has detected that an established 853 security association between the client and server has 854 unexpectedly failed or been compromised, or that the server now 855 requires the client to authenticate using a strong(er) mechanism. 857 - unavailable: This server will stop accepting new connections and 858 operations on all existing connections, and be unavailable for an 859 Lightweight Directory Access Protocol Version 3 861 extended period of time. The client may make use of an alternative 862 server. 864 Upon transmission of the Notice of Disconnection, the server is to 865 consider the LDAP association terminated, MUST cease transmission of 866 messages to the client, and MUST close the connection. 868 4.5. Search Operation 870 The Search Operation is used to request a server to return, subject 871 to access controls and other restrictions, a set of entries matching 872 a complex search criterion. This can be used to read attributes from 873 a single entry, from entries immediately subordinate to a particular 874 entry, or a whole subtree of entries. 876 4.5.1. Search Request 878 The Search Request is defined as follows: 880 SearchRequest ::= [APPLICATION 3] SEQUENCE { 881 baseObject LDAPDN, 882 scope ENUMERATED { 883 baseObject (0), 884 singleLevel (1), 885 wholeSubtree (2) }, 886 derefAliases ENUMERATED { 887 neverDerefAliases (0), 888 derefInSearching (1), 889 derefFindingBaseObj (2), 890 derefAlways (3) }, 891 sizeLimit INTEGER (0 .. maxInt), 892 timeLimit INTEGER (0 .. maxInt), 893 typesOnly BOOLEAN, 894 filter Filter, 895 attributes AttributeSelection } 897 AttributeSelection ::= SEQUENCE OF selection LDAPString 898 -- constrained to below 900 Filter ::= CHOICE { 901 and [0] SET SIZE (1..MAX) OF filter Filter, 902 or [1] SET SIZE (1..MAX) OF filter Filter, 903 not [2] Filter, 904 equalityMatch [3] AttributeValueAssertion, 905 substrings [4] SubstringFilter, 906 greaterOrEqual [5] AttributeValueAssertion, 907 lessOrEqual [6] AttributeValueAssertion, 908 present [7] AttributeDescription, 909 approxMatch [8] AttributeValueAssertion, 910 extensibleMatch [9] MatchingRuleAssertion } 912 SubstringFilter ::= SEQUENCE { 913 Lightweight Directory Access Protocol Version 3 915 type AttributeDescription, 916 -- initial and final can occur at most once 917 substrings SEQUENCE SIZE (1..MAX) OF substring CHOICE { 918 initial [0] AssertionValue, 919 any [1] AssertionValue, 920 final [2] AssertionValue } } 922 MatchingRuleAssertion ::= SEQUENCE { 923 matchingRule [1] MatchingRuleId OPTIONAL, 924 type [2] AttributeDescription OPTIONAL, 925 matchValue [3] AssertionValue, 926 dnAttributes [4] BOOLEAN DEFAULT FALSE } 928 Fields of the Search Request are: 930 - baseObject: The name of the base object entry relative to which 931 the search is to be performed. 933 - scope: Specifies the scope of the search to be performed. The 934 semantics (as described in [X.511]) of the possible values of this 935 field are: 937 baseObject: The scope is constrained to the entry named by 938 baseObject. 940 singleLevel: The scope is constrained to the immediate 941 subordinates of the entry named by baseObject. 943 wholeSubtree: the scope is constrained to the entry named by 944 the baseObject, and all its subordinates. 946 - derefAliases: An indicator as to how alias entries (as defined in 947 [Models]) are to be handled in searching. The semantics of the 948 possible values of this field are: 950 neverDerefAliases: Do not dereference aliases in searching or 951 in locating the base object of the search. 953 derefInSearching: While searching, dereference any alias entry 954 subordinate to the base object which is also in the search 955 scope. The filter is applied to the dereferenced object(s). If 956 the search scope is wholeSubtree, the search continues in the 957 subtree of any dereferenced object. Aliases in that subtree are 958 also dereferenced. Servers SHOULD eliminate duplicate entries 959 that arise due to alias dereferencing while searching. 961 derefFindingBaseObj: Dereference aliases in locating the base 962 object of the search, but not when searching subordinates of 963 the base object. 965 derefAlways: Dereference aliases both in searching and in 966 locating the base object of the search. 968 Lightweight Directory Access Protocol Version 3 970 Servers MUST detect looping while dereferencing aliases in order 971 to prevent denial of service attacks of this nature. 973 - sizeLimit: A size limit that restricts the maximum number of 974 entries to be returned as a result of the search. A value of zero 975 in this field indicates that no client-requested size limit 976 restrictions are in effect for the search. Servers may also 977 enforce a maximum number of entries to return. 979 - timeLimit: A time limit that restricts the maximum time (in 980 seconds) allowed for a search. A value of zero in this field 981 indicates that no client-requested time limit restrictions are in 982 effect for the search. Servers may also enforce a maximum time 983 limit for the search. 985 - typesOnly: An indicator as to whether search results are to 986 contain both attribute descriptions and values, or just attribute 987 descriptions. Setting this field to TRUE causes only attribute 988 descriptions (no values) to be returned. Setting this field to 989 FALSE causes both attribute descriptions and values to be 990 returned. 992 - filter: A filter that defines the conditions that must be 993 fulfilled in order for the search to match a given entry. 995 The 'and', 'or' and 'not' choices can be used to form combinations 996 of filters. At least one filter element MUST be present in an 997 'and' or 'or' choice. The others match against individual 998 attribute values of entries in the scope of the search. 999 (Implementor's note: the 'not' filter is an example of a tagged 1000 choice in an implicitly-tagged module. In BER this is treated as 1001 if the tag was explicit.) 1003 A server MUST evaluate filters according to the three-valued logic 1004 of X.511 (1993) Section 7.8.1. In summary, a filter is evaluated 1005 to either "TRUE", "FALSE" or "Undefined". If the filter evaluates 1006 to TRUE for a particular entry, then the attributes of that entry 1007 are returned as part of the search result (subject to any 1008 applicable access control restrictions). If the filter evaluates 1009 to FALSE or Undefined, then the entry is ignored for the search. 1011 A filter of the "and" choice is TRUE if all the filters in the SET 1012 OF evaluate to TRUE, FALSE if at least one filter is FALSE, and 1013 otherwise Undefined. A filter of the "or" choice is FALSE if all 1014 of the filters in the SET OF evaluate to FALSE, TRUE if at least 1015 one filter is TRUE, and Undefined otherwise. A filter of the 'not' 1016 choice is TRUE if the filter being negated is FALSE, FALSE if it 1017 is TRUE, and Undefined if it is Undefined. 1019 The present match evaluates to TRUE where there is an attribute or 1020 subtype of the specified attribute description present in an 1021 entry, and FALSE otherwise (including a presence test with an 1022 unrecognized attribute description.) 1023 Lightweight Directory Access Protocol Version 3 1025 The matching rule for equalityMatch filter items is defined by the 1026 EQUALITY matching rule for the attribute type. 1028 There SHALL be at most one 'initial', and at most one 'final' in 1029 the 'substrings' of a SubstringFilter. If 'initial' is present, it 1030 SHALL be the first element of 'substrings'. If 'final' is present, 1031 it SHALL be the last element of 'substrings'. 1032 The matching rule for AssertionValues in a substrings filter item 1033 is defined by the SUBSTR matching rule for the attribute type. 1034 Note that the AssertionValue in a substrings filter item conforms 1035 to the assertion syntax of the EQUALITY matching rule for the 1036 attribute type rather than the assertion syntax of the SUBSTR 1037 matching rule for the attribute type. Conceptually, the entire 1038 SubstringFilter is converted into an assertion value of the 1039 substrings matching rule prior to applying the rule. 1041 The matching rule for the greaterOrEqual filter item is defined by 1042 the ORDERING and EQUALITY matching rules for the attribute type. 1044 The matching rule for the lessOrEqual filter item is defined by 1045 the ORDERING matching rule for the attribute type. 1047 An approxMatch filter item evaluates to TRUE when there is a value 1048 of the attribute or subtype for which some locally-defined 1049 approximate matching algorithm (e.g. spelling variations, phonetic 1050 match, etc.) returns TRUE. If an item matches for equality, it 1051 also satisfies an approximate match. If approximate matching is 1052 not supported, this filter item should be treated as an 1053 equalityMatch. 1055 An extensibleMatch filter item is evaluated as follows: 1057 If the matchingRule field is absent, the type field MUST be 1058 present, and an equality match is performed for that type. 1060 If the type field is absent and the matchingRule is present, the 1061 matchValue is compared against all attributes in an entry which 1062 support that matchingRule. The matchingRule determines the 1063 syntax for the assertion value. The filter item evaluates to 1064 TRUE if it matches with at least one attribute in the entry, 1065 FALSE if it does not match any attribute in the entry, and 1066 Undefined if the matchingRule is not recognized or the 1067 assertionValue is invalid. 1069 If the type field is present and the matchingRule is present, 1070 the matchValue is compared against entry attributes of the 1071 specified type. In this case, the matchingRule MUST be one 1072 suitable for use with the specified type (see [Syntaxes]), 1073 otherwise the filter item is Undefined. 1075 If the dnAttributes field is set to TRUE, the match is 1076 additionally applied against all the AttributeValueAssertions in 1077 an entry's distinguished name, and evaluates to TRUE if there is 1078 at least one attribute in the distinguished name for which the 1079 Lightweight Directory Access Protocol Version 3 1081 filter item evaluates to TRUE. The dnAttributes field is present 1082 to alleviate the need for multiple versions of generic matching 1083 rules (such as word matching), where one applies to entries and 1084 another applies to entries and dn attributes as well. 1086 A filter item evaluates to Undefined when the server would not be 1087 able to determine whether the assertion value matches an entry. If 1088 an attribute description in an equalityMatch, substrings, 1089 greaterOrEqual, lessOrEqual, approxMatch or extensibleMatch filter 1090 is not recognized by the server, a matching rule id in the 1091 extensibleMatch is not recognized by the server, the assertion 1092 value is invalid, or the type of filtering requested is not 1093 implemented, then the filter is Undefined. Thus for example if a 1094 server did not recognize the attribute type shoeSize, a filter of 1095 (shoeSize=*) would evaluate to FALSE, and the filters 1096 (shoeSize=12), (shoeSize>=12) and (shoeSize<=12) would evaluate to 1097 Undefined. 1099 Servers MUST NOT return errors if attribute descriptions or 1100 matching rule ids are not recognized, assertion values are 1101 invalid, or the assertion syntax is not supported. More details of 1102 filter processing are given in Section 7.8 of [X.511]. 1104 - attributes: A list of the attributes to be returned from each 1105 entry which matches the search filter. LDAPString values of this 1106 field are constrained to the following Augmented Backus-Naur Form 1107 ([ABNF]): 1109 attributeSelection = noattrs / 1110 *( attributedescription / specialattr ) 1112 noattrs = %x31 %x2E %x31 ; "1.1" 1114 specialattr = ASTERISK 1116 ASTERISK = %x2A ; asterisk ("*") 1118 The production is defined in Section 2.5 of 1119 [Models]. 1121 There are two special values which may be used: an empty list with 1122 no attributes, and the attribute description string "*". Both of 1123 these signify that all user attributes are to be returned. (The 1124 "*" allows the client to request all user attributes in addition 1125 to any specified operational attributes). Client implementors 1126 should note that even if all user attributes are requested, some 1127 attributes and/or attribute values of the entry may not be 1128 included in search results due to access controls or other 1129 restrictions. Furthermore, servers will not return operational 1130 attributes, such as objectClasses or attributeTypes, unless they 1131 are listed by name. Operational attributes are described in 1132 [Models]. 1134 Attributes MUST NOT be named more than once in the list, and are 1135 Lightweight Directory Access Protocol Version 3 1137 returned at most once in an entry. If there are attribute 1138 descriptions in the list which are not recognized, they are 1139 ignored by the server. 1141 If the client does not want any attributes returned, it can 1142 specify a list containing only the attribute with OID "1.1". This 1143 OID was chosen because it does not (and can not) correspond to any 1144 attribute in use. 1146 Note that an X.500 "list"-like operation can be emulated by the 1147 client requesting a one-level LDAP search operation with a filter 1148 checking for the presence of the 'objectClass' attribute, and that an 1149 X.500 "read"-like operation can be emulated by a base object LDAP 1150 search operation with the same filter. A server which provides a 1151 gateway to X.500 is not required to use the Read or List operations, 1152 although it may choose to do so, and if it does, it must provide the 1153 same semantics as the X.500 search operation. 1155 4.5.2. Search Result 1157 The results of the search operation are returned as zero or more 1158 searchResultEntry messages, zero or more SearchResultReference 1159 messages, followed by a single searchResultDone message. 1161 SearchResultEntry ::= [APPLICATION 4] SEQUENCE { 1162 objectName LDAPDN, 1163 attributes PartialAttributeList } 1165 PartialAttributeList ::= SEQUENCE OF 1166 partialAttribute PartialAttribute 1167 -- Note that the PartialAttributeList may hold zero elements. 1168 -- This may happen when none of the attributes of an entry 1169 -- were requested, or could be returned. 1170 -- Note also that the partialAttribute vals set may hold zero 1171 -- elements. This may happen when typesOnly is requested, access 1172 -- controls prevent the return of values, or other reasons. 1174 SearchResultReference ::= [APPLICATION 19] SEQUENCE 1175 SIZE (1..MAX) OF uri URI 1177 SearchResultDone ::= [APPLICATION 5] LDAPResult 1179 Each SearchResultEntry represents an entry found during the search. 1180 Each SearchResultReference represents an area not yet explored during 1181 the search. The SearchResultEntry and SearchResultReference PDUs may 1182 come in any order. Following all the SearchResultReference and 1183 SearchResultEntry responses, the server returns a SearchResultDone 1184 response, which contains an indication of success, or detailing any 1185 errors that have occurred. 1187 Each entry returned in a SearchResultEntry will contain all 1188 appropriate attributes as specified in the attributes field of the 1189 Lightweight Directory Access Protocol Version 3 1191 Search Request. Return of attributes is subject to access control and 1192 other administrative policy. 1194 Some attributes may be constructed by the server and appear in a 1195 SearchResultEntry attribute list, although they are not stored 1196 attributes of an entry. Clients SHOULD NOT assume that all attributes 1197 can be modified, even if permitted by access control. 1199 If the server's schema defines short names [Models] for an attribute 1200 type then the server SHOULD use one of those names in attribute 1201 descriptions for that attribute type (in preference to using the 1202 [Models] format of the attribute type's object 1203 identifier). The server SHOULD NOT use the short name if that name is 1204 known by the server to be ambiguous, or otherwise likely to cause 1205 interoperability problems. 1207 4.5.3. Continuation References in the Search Result 1209 If the server was able to locate the entry referred to by the 1210 baseObject but was unable to search one or more non-local entries, 1211 the server may return one or more SearchResultReference entries, each 1212 containing a reference to another set of servers for continuing the 1213 operation. A server MUST NOT return any SearchResultReference if it 1214 has not located the baseObject and thus has not searched any entries; 1215 in this case it would return a SearchResultDone containing a referral 1216 result code. 1218 If a server holds a copy or partial copy of the subordinate naming 1219 context [Section 5 of Models], it may use the search filter to 1220 determine whether or not to return a SearchResultReference response. 1221 Otherwise SearchResultReference responses are always returned when in 1222 scope. 1224 The SearchResultReference is of the same data type as the Referral. 1226 A URI for a server implementing LDAP and accessible via [TCP]/[IP] 1227 (v4 or v6) is written as an LDAP URL according to [LDAPURL]. 1229 In order to complete the search, the client issues a new search 1230 operation for each SearchResultReference that is returned. Note that 1231 the abandon operation described in Section 4.11 applies only to a 1232 particular operation sent on an association between a client and 1233 server. The client must abandon subsequent search operations it 1234 wishes to individually. 1236 Clients that follow search continuation references MUST ensure that 1237 they do not loop between servers. They MUST NOT repeatedly contact 1238 the same server for the same request with the same target entry name, 1239 scope and filter. Some clients use a counter that is incremented each 1240 time search result reference handling occurs for an operation, and 1241 these kinds of clients MUST be able to handle at least ten nested 1242 search result references between the root and a leaf entry. 1244 Lightweight Directory Access Protocol Version 3 1246 When an LDAP URL is used, the following instructions are followed: 1248 - The part of the URL MUST be present, with the new target 1249 object name. The client MUST use this name when following the 1250 reference. UTF-8 encoded characters appearing in the string 1251 representation of a DN or search filter may not be legal for URLs 1252 (e.g. spaces) and MUST be escaped using the % method in [URI]. 1253 - Some servers (e.g. participating in distributed indexing) may 1254 provide a different filter in a URL of a SearchResultReference. 1255 - If the part of the URL is present, the client MUST use 1256 this filter in its next request to progress this search, and if it 1257 is not present the client MUST use the same filter as it used for 1258 that search. 1259 - If the originating search scope was singleLevel, the part 1260 of the URL will be "base". 1261 - it is RECOMMENDED that the part be present to avoid 1262 ambiguity. 1263 - Other aspects of the new search request may be the same as or 1264 different from the search request which generated the 1265 SearchResultReference. 1266 - The name of an unexplored subtree in a SearchResultReference need 1267 not be subordinate to the base object. 1269 Other kinds of URIs may be returned. The syntax and semantics of such 1270 URIs is left to future specifications. Clients may ignore URIs that 1271 they do not support. 1273 4.5.3.1. Examples 1275 For example, suppose the contacted server (hosta) holds the entry 1276 and the entry . It 1277 knows that either LDAP-capable servers (hostb) or (hostc) hold 1278 (one is the master and the other server 1279 a shadow), and that LDAP-capable server (hostd) holds the subtree 1280 . If a wholeSubtree search of 1281 is requested to the contacted server, it may 1282 return the following: 1284 SearchResultEntry for DC=Example,DC=NET 1285 SearchResultEntry for CN=Manager,DC=Example,DC=NET 1286 SearchResultReference { 1287 ldap://hostb/OU=People,DC=Example,DC=NET??sub 1288 ldap://hostc/OU=People,DC=Example,DC=NET??sub } 1289 SearchResultReference { 1290 ldap://hostd/OU=Roles,DC=Example,DC=NET??sub } 1291 SearchResultDone (success) 1293 Client implementors should note that when following a 1294 SearchResultReference, additional SearchResultReference may be 1295 generated. Continuing the example, if the client contacted the server 1296 (hostb) and issued the search for the subtree 1297 , the server might respond as follows: 1299 Lightweight Directory Access Protocol Version 3 1301 SearchResultEntry for OU=People,DC=Example,DC=NET 1302 SearchResultReference { 1303 ldap://hoste/OU=Managers,OU=People,DC=Example,DC=NET??sub } 1304 SearchResultReference { 1305 ldap://hostf/OU=Consultants,OU=People,DC=Example,DC=NET??sub } 1306 SearchResultDone (success) 1308 Similarly, if a singleLevel search of is 1309 requested to the contacted server, it may return the following: 1311 SearchResultEntry for CN=Manager,DC=Example,DC=NET 1312 SearchResultReference { 1313 ldap://hostb/OU=People,DC=Example,DC=NET??base 1314 ldap://hostc/OU=People,DC=Example,DC=NET??base } 1315 SearchResultReference { 1316 ldap://hostd/OU=Roles,DC=Example,DC=NET??base } 1317 SearchResultDone (success) 1319 If the contacted server does not hold the base object for the search, 1320 then it will return a referral to the client. For example, if the 1321 client requests a subtree search of to hosta, the 1322 server may return only a SearchResultDone containing a referral. 1324 SearchResultDone (referral) { 1325 ldap://hostg/DC=Example,DC=ORG??sub } 1327 4.6. Modify Operation 1329 The Modify Operation allows a client to request that a modification 1330 of an entry be performed on its behalf by a server. The Modify 1331 Request is defined as follows: 1333 ModifyRequest ::= [APPLICATION 6] SEQUENCE { 1334 object LDAPDN, 1335 changes SEQUENCE OF change SEQUENCE { 1336 operation ENUMERATED { 1337 add (0), 1338 delete (1), 1339 replace (2) }, 1340 modification PartialAttribute } } 1342 Fields of the Modify Request are: 1344 - object: The name of the object to be modified. The value of this 1345 field contains the DN of the entry to be modified. The server 1346 SHALL NOT perform any alias dereferencing in determining the 1347 object to be modified. 1349 - changes: A list of modifications to be performed on the entry. The 1350 entire list of modifications MUST be performed in the order they 1351 are listed as a single atomic operation. While individual 1352 modifications may violate certain aspects of the directory schema 1353 (such as the object class definition and DIT content rule), the 1354 Lightweight Directory Access Protocol Version 3 1356 resulting entry after the entire list of modifications is 1357 performed MUST conform to the requirements of the directory schema 1358 [Models]. 1360 - operation: Used to specify the type of modification being 1361 performed. Each operation type acts on the following 1362 modification. The values of this field have the following 1363 semantics respectively: 1365 add: add values listed to the modification attribute, 1366 creating the attribute if necessary; 1368 delete: delete values listed from the modification attribute, 1369 removing the entire attribute if no values are listed, or if 1370 all current values of the attribute are listed for deletion; 1372 replace: replace all existing values of the modification 1373 attribute with the new values listed, creating the attribute 1374 if it did not already exist. A replace with no value will 1375 delete the entire attribute if it exists, and is ignored if 1376 the attribute does not exist. 1378 - modification: A PartialAttribute (which may have an empty SET 1379 of vals) used to hold the attribute type or attribute type and 1380 values being modified. 1382 Upon receipt of a Modify Request, the server attempts to perform the 1383 necessary modifications to the DIT and returns the result in a Modify 1384 Response, defined as follows: 1386 ModifyResponse ::= [APPLICATION 7] LDAPResult 1388 The server will return to the client a single Modify Response 1389 indicating either the successful completion of the DIT modification, 1390 or the reason that the modification failed. Due to the requirement 1391 for atomicity in applying the list of modifications in the Modify 1392 Request, the client may expect that no modifications of the DIT have 1393 been performed if the Modify Response received indicates any sort of 1394 error, and that all requested modifications have been performed if 1395 the Modify Response indicates successful completion of the Modify 1396 Operation. If the association changes or the connection fails, 1397 whether the modification occurred or not is indeterminate. 1399 The Modify Operation cannot be used to remove from an entry any of 1400 its distinguished values, i.e. those values which form the entry's 1401 relative distinguished name. An attempt to do so will result in the 1402 server returning the notAllowedOnRDN result code. The Modify DN 1403 Operation described in Section 4.9 is used to rename an entry. 1405 Note that due to the simplifications made in LDAP, there is not a 1406 direct mapping of the changes in an LDAP ModifyRequest onto the 1407 changes of a DAP ModifyEntry operation, and different implementations 1408 of LDAP-DAP gateways may use different means of representing the 1409 Lightweight Directory Access Protocol Version 3 1411 change. If successful, the final effect of the operations on the 1412 entry MUST be identical. 1414 4.7. Add Operation 1416 The Add Operation allows a client to request the addition of an entry 1417 into the Directory. The Add Request is defined as follows: 1419 AddRequest ::= [APPLICATION 8] SEQUENCE { 1420 entry LDAPDN, 1421 attributes AttributeList } 1423 AttributeList ::= SEQUENCE OF attribute Attribute 1425 Fields of the Add Request are: 1427 - entry: the name of the entry to be added. The server SHALL NOT 1428 dereference any aliases in locating the entry to be added. 1430 - attributes: the list of attributes that make up the content of the 1431 entry being added. Clients MUST include distinguished values 1432 (those forming the entry's own RDN) in this list, the 1433 'objectClass' attribute, and values of any mandatory attributes of 1434 the listed object classes. Clients MUST NOT supply NO-USER- 1435 MODIFICATION attributes such as the createTimestamp or 1436 creatorsName attributes, since the server maintains these 1437 automatically. 1439 The entry named in the entry field of the AddRequest MUST NOT exist 1440 for the AddRequest to succeed. The immediate superior (parent) of an 1441 object or alias entry to be added MUST exist. For example, if the 1442 client attempted to add , the 1443 entry did not exist, and the entry did 1444 exist, then the server would return the noSuchObject result code with 1445 the matchedDN field containing . If the parent entry exists 1446 but is not in a naming context [Section 5 of Models] held by the 1447 server, the server SHOULD return a referral to the server holding the 1448 parent entry. 1450 Server implementations SHOULD NOT restrict where entries can be 1451 located in the Directory unless DIT structure rules are in place. 1452 Some servers allow the administrator to restrict the classes of 1453 entries which can be added to the Directory. 1455 Upon receipt of an Add Request, a server will attempt to add the 1456 requested entry. The result of the add attempt will be returned to 1457 the client in the Add Response, defined as follows: 1459 AddResponse ::= [APPLICATION 9] LDAPResult 1461 A response of success indicates that the new entry has been added to 1462 the Directory. 1464 Lightweight Directory Access Protocol Version 3 1466 4.8. Delete Operation 1468 The Delete Operation allows a client to request the removal of an 1469 entry from the Directory. The Delete Request is defined as follows: 1471 DelRequest ::= [APPLICATION 10] LDAPDN 1473 The Delete Request consists of the name of the entry to be deleted. 1474 The server SHALL NOT dereference aliases while resolving the name of 1475 the target entry to be removed. 1477 Only leaf entries (those with no subordinate entries) can be deleted 1478 with this operation. 1480 Upon receipt of a Delete Request, a server will attempt to perform 1481 the entry removal requested and return the result in the Delete 1482 Response defined as follows: 1484 DelResponse ::= [APPLICATION 11] LDAPResult 1486 4.9. Modify DN Operation 1488 The Modify DN Operation allows a client to change the Relative 1489 Distinguished Name (RDN) of an entry in the Directory, and/or to move 1490 a subtree of entries to a new location in the Directory. The Modify 1491 DN Request is defined as follows: 1493 ModifyDNRequest ::= [APPLICATION 12] SEQUENCE { 1494 entry LDAPDN, 1495 newrdn RelativeLDAPDN, 1496 deleteoldrdn BOOLEAN, 1497 newSuperior [0] LDAPDN OPTIONAL } 1499 Fields of the Modify DN Request are: 1501 - entry: the name of the entry to be changed. This entry may or may 1502 not have subordinate entries. 1504 - newrdn: the new RDN of the entry. 1506 - deleteoldrdn: a boolean field that controls whether the old RDN 1507 attribute values are to be retained as attributes of the entry, or 1508 deleted from the entry. 1510 - newSuperior: if present, this is the name of an existing object 1511 entry which becomes the immediate superior (parent) of the 1512 existing entry. 1514 The server SHALL NOT dereference any aliases in locating the objects 1515 named in entry or newSuperior. 1517 Lightweight Directory Access Protocol Version 3 1519 Upon receipt of a ModifyDNRequest, a server will attempt to perform 1520 the name change and return the result in the Modify DN Response, 1521 defined as follows: 1523 ModifyDNResponse ::= [APPLICATION 13] LDAPResult 1525 For example, if the entry named in the entry field was , the newrdn field was , and the 1527 newSuperior field was absent, then this operation would attempt to 1528 rename the entry to be . If there was 1529 already an entry with that name, the operation would fail with the 1530 entryAlreadyExists result code. 1532 The object named in newSuperior MUST exist. For example, if the 1533 client attempted to add , the 1534 entry did not exist, and the entry did 1535 exist, then the server would return the noSuchObject result code with 1536 the matchedDN field containing . 1538 If the deleteoldrdn field is TRUE, the attribute values forming the 1539 old RDN but not the new RDN are deleted from the entry. If the 1540 deleteoldrdn field is FALSE, the attribute values forming the old RDN 1541 will be retained as non-distinguished attribute values of the entry. 1542 The server MUST fail the operation and return an error in the result 1543 code if the setting of the deleteoldrdn field would cause a schema 1544 inconsistency in the entry. 1546 Note that X.500 restricts the ModifyDN operation to only affect 1547 entries that are contained within a single server. If the LDAP server 1548 is mapped onto DAP, then this restriction will apply, and the 1549 affectsMultipleDSAs result code will be returned if this error 1550 occurred. In general, clients MUST NOT expect to be able to perform 1551 arbitrary movements of entries and subtrees between servers or 1552 between naming contexts. 1554 4.10. Compare Operation 1556 The Compare Operation allows a client to compare an assertion value 1557 with the values of a particular attribute in a particular entry in 1558 the Directory. The Compare Request is defined as follows: 1560 CompareRequest ::= [APPLICATION 14] SEQUENCE { 1561 entry LDAPDN, 1562 ava AttributeValueAssertion } 1564 Fields of the Compare Request are: 1566 - entry: the name of the entry to be compared. The server SHALL NOT 1567 dereference any aliases in locating the entry to be compared. 1569 - ava: holds the attribute description and assertion value with 1570 which an attribute in the entry is to be compared. 1572 Lightweight Directory Access Protocol Version 3 1574 Upon receipt of a Compare Request, a server will attempt to perform 1575 the requested comparison and return the result in the Compare 1576 Response, defined as follows: 1578 CompareResponse ::= [APPLICATION 15] LDAPResult 1580 If the operation succeeds (e.g. the attribute or subtype is present 1581 and access controls allow comparison), the resultCode field will be 1582 compareTrue if the assertion value in the ava field is equivalent to 1583 any value of the attribute or subtype (according to the attribute's 1584 EQUALITY matching rule). Otherwise compareFalse is returned in the 1585 resultCode field. 1587 In the event that the attribute or subtype is not present in the 1588 entry, the resultCode field is set to noSuchAttribute. If the 1589 attribute is unknown, the resultCode is set to 1590 undefinedAttributeType. Note that errors and the result of comparison 1591 are all returned in the same construct. 1593 Note that some directory systems may establish access controls which 1594 permit the values of certain attributes (such as userPassword) to be 1595 compared but not interrogated by other means. 1597 4.11. Abandon Operation 1599 The function of the Abandon Operation is to allow a client to request 1600 that the server abandon an outstanding operation. The Abandon Request 1601 is defined as follows: 1603 AbandonRequest ::= [APPLICATION 16] MessageID 1605 The MessageID is that of an operation which was requested earlier in 1606 this LDAP association. The abandon request itself has its own message 1607 id. This is distinct from the id of the earlier operation being 1608 abandoned. 1610 There is no response defined in the Abandon operation. Upon receipt 1611 of an AbandonRequest, the server MAY abandon the operation identified 1612 by the MessageID. Operation responses are not sent for successfully 1613 abandoned operations, thus the application of the Abandon operation 1614 is limited to uses where the client does not require an indication of 1615 its outcome. 1617 Abandon, Bind, Unbind, and StartTLS operations cannot be abandoned. 1618 The ability to abandon other (particularly update) operations is at 1619 the discretion of the server. 1621 In the event that a server receives an Abandon Request on a Search 1622 Operation in the midst of transmitting responses to the search, that 1623 server MUST cease transmitting entry responses to the abandoned 1624 request immediately, and MUST NOT send the SearchResponseDone. Of 1625 course, the server MUST ensure that only properly encoded LDAPMessage 1626 PDUs are transmitted. 1628 Lightweight Directory Access Protocol Version 3 1630 Clients should not send abandon requests for the same operation 1631 multiple times, and MUST also be prepared to receive results from 1632 operations it has abandoned (since these may have been in transit 1633 when the abandon was requested, or are not able to be abandoned). 1635 Servers MUST discard abandon requests for message IDs they do not 1636 recognize, for operations which cannot be abandoned, and for 1637 operations which have already been abandoned. 1639 4.12. Extended Operation 1641 The extended operation allows additional operations to be defined for 1642 services not already available in the protocol. For example, to add 1643 operations to install transport layer security (see Section 4.13). 1645 The extended operation allows clients to make requests and receive 1646 responses with predefined syntaxes and semantics. These may be 1647 defined in RFCs or be private to particular implementations. 1649 Each extended operation consists of an extended request and an 1650 extended response. 1652 ExtendedRequest ::= [APPLICATION 23] SEQUENCE { 1653 requestName [0] LDAPOID, 1654 requestValue [1] OCTET STRING OPTIONAL } 1656 The requestName is a dotted-decimal representation of the unique 1657 OBJECT IDENTIFIER corresponding to the request. The requestValue is 1658 information in a form defined by that request, encapsulated inside an 1659 OCTET STRING. 1661 The server will respond to this with an LDAPMessage containing an 1662 ExtendedResponse. 1664 ExtendedResponse ::= [APPLICATION 24] SEQUENCE { 1665 COMPONENTS OF LDAPResult, 1666 responseName [10] LDAPOID OPTIONAL, 1667 responseValue [11] OCTET STRING OPTIONAL } 1669 The responseName is typically not required to be present as the 1670 syntax and semantics of the response (including the format of the 1671 responseValue) is implicitly known and associated with the request by 1672 the messageID. 1674 If the requestName is not recognized by the server, the server MUST 1675 NOT provide a responseName nor a responseValue and MUST return a 1676 resultCode of protocolError. 1678 The requestValue and responseValue fields contain any information 1679 associated with the operation. The format of these fields is defined 1680 by the specification of the extended operation. Implementations MUST 1681 be prepared to handle arbitrary contents of these fields, including 1682 Lightweight Directory Access Protocol Version 3 1684 zero bytes. Values that are defined in terms of ASN.1 and BER encoded 1685 according to Section 5.1, also follow the extensibility rules in 1686 Section 4. 1688 It is RECOMMENDED that servers list the requestName of extended 1689 operations they support in the 'supportedExtension' attribute of the 1690 root DSE [Models]. 1692 Extended operations may be specified in other documents. The 1693 specification of an extended operation consists of: 1695 - the OBJECT IDENTIFIER assigned to the requestName (and possibly 1696 responseName), 1698 - the format of the contents of the requestValue and responseValue 1699 (if any), and 1701 - the semantics of the operation. 1703 4.13. StartTLS Operation 1705 The Start Transport Layer Security (StartTLS) operation provides the 1706 ability to establish Transport Layer Security ([TLS]) on an LDAP 1707 connection. The StartTLS operation is defined using the extended 1708 operation mechanism described in Section 4.12. 1710 4.13.1. StartTLS Request 1712 A client requests TLS establishment by transmitting a StartTLS 1713 request PDU to the server. The StartTLS request is defined in terms 1714 of an ExtendedRequest. The requestName is "1.3.6.1.4.1.1466.20037", 1715 and the requestValue field is always absent. 1717 The client MUST NOT send any PDUs on this connection following this 1718 request until it receives a StartTLS extended response and completes 1719 TLS negotiations. 1721 4.13.2. StartTLS Response 1723 When a StartTLS request is made, servers supporting the operation 1724 MUST return a StartTLS response PDU to the requestor. The 1725 responseName is also "1.3.6.1.4.1.1466.20037", and the responseValue 1726 field is absent. 1728 The server provides a resultCode field to either success or one of 1729 the other values outlined in Section 4.13.2.2. 1731 4.13.2.1. "Success" Response 1733 If the StartTLS Response contains a resultCode of success, this 1734 indicates that the server is willing and able to negotiate TLS. Refer 1735 to Section 4 of [AuthMeth] for details. 1737 Lightweight Directory Access Protocol Version 3 1739 4.13.2.2. Response other than "success" 1741 If the ExtendedResponse contains a result code other than success, 1742 this indicates that the server is unwilling or unable to negotiate 1743 TLS. The following result codes have these meanings for this 1744 operation: 1746 - operationsError: operations sequencing incorrect; e.g. TLS is 1747 already established. 1749 - protocolError: TLS is not supported or incorrect PDU structure. 1751 - unavailable: Some major problem with TLS, or the server is 1752 shutting down. 1754 The server MUST return operationsError if the client violates any of 1755 the StartTLS extended operation sequencing requirements described in 1756 Section 4 of [AuthMeth]. 1758 If the server does not support TLS (whether by design or by current 1759 configuration), it MUST return the protocolError resultCode. The 1760 client's current association is unaffected if the server does not 1761 support TLS. The client may proceed with any LDAP operation, or it 1762 may close the connection. 1764 The server MUST return unavailable if it supports TLS but cannot 1765 establish a TLS connection for some reason, e.g. the certificate 1766 server not responding, it cannot contact its TLS implementation, or 1767 if the server is in process of shutting down. The client may retry 1768 the StartTLS operation, or it may proceed with any other LDAP 1769 operation, or it may close the LDAP connection. 1771 4.13.3. Closing a TLS Connection 1773 Two forms of TLS connection closure -- graceful and abrupt -- are 1774 supported. These do not involve LDAP PDUs, but are preformed at the 1775 underlying layers. 1777 4.13.3.1. Graceful Closure 1779 Either the client or server MAY terminate the TLS connection and 1780 leave the LDAP connection intact by sending and receiving a TLS 1781 closure alert. 1783 The initiating protocol peer sends the TLS closure alert. If it 1784 wishes to leave the LDAP connection intact, it then MUST cease to 1785 send further PDUs and MUST ignore any received PDUs until it receives 1786 a TLS closure alert from the other peer. 1788 Once the initiating protocol peer receives a TLS closure alert from 1789 the other peer it MAY send and receive LDAP PDUs. 1791 Lightweight Directory Access Protocol Version 3 1793 When a protocol peer receives the initial TLS closure alert, it may 1794 choose to allow the underlying LDAP connection to remain intact. In 1795 this case, it MUST immediately transmit a TLS closure alert. 1796 Following this, it MAY send and receive LDAP PDUs. 1798 Protocol peers MAY drop the underlying LDAP connection after sending 1799 or receiving a TLS closure alert. 1801 After the TLS connection has been closed, the server MUST NOT send 1802 responses to any request message received before the TLS closure. 1803 Thus, clients wishing to receive responses to messages sent while the 1804 TLS connection is intact MUST wait for those message responses before 1805 sending the TLS closure alert. 1807 4.13.3.2. Abrupt Closure 1809 Either the client or server MAY abruptly close the TLS connection by 1810 dropping the underlying transfer protocol connection. In this 1811 circumstance, a server MAY send the client a Notice of Disconnection 1812 before dropping the underlying LDAP connection. Outstanding 1813 operations are handled as specified in Section 5.2. 1815 5. Protocol Element Encodings and Transfer 1817 One underlying service, LDAP over TCP, is defined here. This service 1818 is generally applicable to applications providing or consuming X.500- 1819 based directory services on the Internet. 1821 Implementations of LDAP over TCP MUST implement the mapping as 1822 described in Section 5.2.1 1824 5.1. Protocol Encoding 1826 The protocol elements of LDAP SHALL be encoded for exchange using the 1827 Basic Encoding Rules [BER] of [ASN.1] with the following 1828 restrictions: 1830 - Only the definite form of length encoding is used. 1832 - OCTET STRING values are encoded in the primitive form only. 1834 - If the value of a BOOLEAN type is true, the encoding of the value 1835 octet is set to hex "FF". 1837 - If a value of a type is its default value, it is absent. Only some 1838 BOOLEAN and INTEGER types have default values in this protocol 1839 definition. 1841 These restrictions are meant to ease the overhead of encoding and 1842 decoding certain elements in BER. 1844 Lightweight Directory Access Protocol Version 3 1846 These restrictions do not apply to ASN.1 types encapsulated inside of 1847 OCTET STRING values, such as attribute values, unless otherwise 1848 stated. 1850 5.2. Transfer Protocols 1852 This protocol is designed to run over connection-oriented, reliable 1853 transports, with all 8 bits in an octet being significant in the data 1854 stream. Protocol operations are tied to a connection, thus if the 1855 connection is closed or dropped, the operation is aborted. When this 1856 happens, any outstanding operations on the server are, when possible, 1857 abandoned, and when not possible, completed without transmission of 1858 the response. Also, if the connection is closed or dropped, the 1859 client MUST NOT assume that any outstanding requests which modified 1860 the Directory have succeeded or failed. 1862 5.2.1. Transmission Control Protocol (TCP) 1864 The encoded LDAPMessage PDUs are mapped directly onto the [TCP] 1865 bytestream using the BER-based encoding described in Section 5.1. It 1866 is recommended that server implementations running over the TCP 1867 provide a protocol listener on the Internet Assigned Numbers 1868 Authority (IANA)-assigned LDAP port, 389 [PortReg]. Servers may 1869 instead provide a listener on a different port number. Clients MUST 1870 support contacting servers on any valid TCP port. 1872 6. Security Considerations 1874 This version of the protocol provides facilities for simple 1875 authentication using a cleartext password, as well as any [SASL] 1876 mechanism. SASL allows for integrity and privacy services to be 1877 negotiated. 1879 It is also permitted that the server can return its credentials to 1880 the client, if it chooses to do so. 1882 Use of cleartext password is strongly discouraged where the 1883 underlying transport service cannot guarantee confidentiality and may 1884 result in disclosure of the password to unauthorized parties. 1886 Servers are encouraged to prevent directory modifications by clients 1887 that have authenticated anonymously [AuthMeth]. 1889 Requirements of authentication methods, SASL mechanisms, and TLS are 1890 described in [AuthMeth]. 1892 It should be noted that SASL authentication exchanges do not provide 1893 data confidentiality nor integrity protection for the version or name 1894 fields of the bind request nor the resultCode, diagnosticMessage, or 1895 referral fields of the bind response nor of any information contained 1896 in controls attached to bind request or responses. Thus information 1897 Lightweight Directory Access Protocol Version 3 1899 contained in these fields SHOULD NOT be relied on unless otherwise 1900 protected (such as by establishing protections at the transport 1901 layer). 1903 Server implementors should plan for the possibility of an identity 1904 associated with an LDAP connection being deleted, renamed, or 1905 modified, and take appropriate actions to prevent insecure side 1906 effects. Likewise, server implementors should plan for the 1907 possibility of an associated identity's credentials becoming invalid, 1908 or an identity's privileges being changed. The ways in which these 1909 issues are addressed are application and/or implementation specific. 1911 Implementations which cache attributes and entries obtained via LDAP 1912 MUST ensure that access controls are maintained if that information 1913 is to be provided to multiple clients, since servers may have access 1914 control policies which prevent the return of entries or attributes in 1915 search results except to particular authenticated clients. For 1916 example, caches could serve result information only to the client 1917 whose request caused it to be in the cache. 1919 Servers may return referrals or search result references which 1920 redirect clients to peer servers. It is possible for a rogue 1921 application to inject such referrals into the data stream in an 1922 attempt to redirect a client to a rogue server. Clients are advised 1923 to be aware of this, and possibly reject referrals when 1924 confidentiality measures are not in place. Clients are advised to 1925 reject referrals from the StartTLS operation. 1927 Protocol peers MUST be prepared to handle invalid and arbitrary 1928 length protocol encodings. A number of LDAP security advisories are 1929 available through [CERT]. 1931 7. Acknowledgements 1933 This document is based on RFC 2251 by Mark Wahl, Tim Howes, and Steve 1934 Kille. It is also based on RFC 2830 by Jeff Hodges, RL "Bob" Morgan, 1935 and Mark Wahl. Their work along with the input of individuals of the 1936 IETF ASID, LDAPEXT, LDUP, LDAPBIS, and other Working Groups is 1937 gratefully acknowledged. 1939 8. Normative References 1941 [ABNF] Crocker, D. and P. Overell, "Augmented BNF for Syntax 1942 Specifications: ABNF", RFC 2234, November 1997. 1944 [ASN.1] ITU-T Recommendation X.680 (07/2002) | ISO/IEC 8824-1:2002 1945 "Information Technology - Abstract Syntax Notation One 1946 (ASN.1): Specification of basic notation" 1948 [AuthMeth] Harrison, R., "LDAP: Authentication Methods and Connection 1949 Level Security Mechanisms", draft-ietf-ldapbis-authmeth- 1950 xx.txt, (a work in progress). 1952 Lightweight Directory Access Protocol Version 3 1954 [BER] ITU-T Rec. X.690 (07/2002) | ISO/IEC 8825-1:2002, 1955 "Information technology - ASN.1 encoding rules: 1956 Specification of Basic Encoding Rules (BER), Canonical 1957 Encoding Rules (CER) and Distinguished Encoding Rules 1958 (DER)", 2002. 1960 [IP] Postel, J., "Internet Protocol", STD5 and RFC 791, 1961 September 1981 1963 [ISO10646] Universal Multiple-Octet Coded Character Set (UCS) - 1964 Architecture and Basic Multilingual Plane, ISO/IEC 10646-1 1965 : 1993. 1967 [Keyword] Bradner, S., "Key words for use in RFCs to Indicate 1968 Requirement Levels", RFC 2119, March 1997. 1970 [LDAPDN] Zeilenga, K., "LDAP: String Representation of 1971 Distinguished Names", draft-ietf-ldapbis-dn-xx.txt, (a 1972 work in progress). 1974 [LDAPIANA] Zeilenga, K., "IANA Considerations for LDAP", draft-ietf- 1975 ldapbis-bcp64-xx.txt, (a work in progress). 1977 [LDAPURL] Smith, M., "LDAP: Uniform Resource Locator", draft-ietf- 1978 ldapbis-url-xx.txt, (a work in progress). 1980 [Models] Zeilenga, K., "LDAP: Directory Information Models", draft- 1981 ietf-ldapbis-models-xx.txt (a work in progress). 1983 [Roadmap] Zeilenga, K., "LDAP: Technical Specification Road Map", 1984 draft-ietf-ldapbis-roadmap-xx.txt (a work in progress). 1986 [SASL] Melnikov, A., "Simple Authentication and Security Layer", 1987 draft-ietf-sasl-rfc2222bis-xx.txt (a work in progress). 1989 [SASLPrep] Zeilenga, K., "Stringprep profile for user names and 1990 passwords", draft-ietf-sasl-saslprep-xx.txt, (a work in 1991 progress). 1993 [StringPrep] Hoffman P. and M. Blanchet, "Preparation of 1994 Internationalized Strings ('stringprep')", draft-hoffman- 1995 rfc3454bis-xx.txt, a work in progress. 1997 [Syntaxes] Legg, S., and K. Dally, "LDAP: Syntaxes and Matching 1998 Rules", draft-ietf-ldapbis-syntaxes-xx.txt, (a work in 1999 progress). 2001 [TCP] Postel, J., "Transmission Control Protocol", STD7 and RFC 2002 793, September 1981 2004 [TLS] Dierks, T. and C. Allen. "The TLS Protocol Version 1.1", 2005 draft-ietf-tls-rfc2246-bis-xx.txt, a work in progress. 2007 Lightweight Directory Access Protocol Version 3 2009 [Unicode] The Unicode Consortium, "The Unicode Standard, Version 2010 3.2.0" is defined by "The Unicode Standard, Version 3.0" 2011 (Reading, MA, Addison-Wesley, 2000. ISBN 0-201-61633-5), 2012 as amended by the "Unicode Standard Annex #27: Unicode 2013 3.1" (http://www.unicode.org/reports/tr27/) and by the 2014 "Unicode Standard Annex #28: Unicode 3.2" 2015 (http://www.unicode.org/reports/tr28/). 2017 [URI] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 2018 Resource Identifiers (URI): Generic Syntax", RFC 2396, 2019 August 1998. 2021 [UTF-8] Yergeau, F., "UTF-8, a transformation format of ISO 2022 10646", STD63 and RFC3629, November 2003. 2024 [X.500] ITU-T Rec. X.500, "The Directory: Overview of Concepts, 2025 Models and Service", 1993. 2027 [X.501] ITU-T Rec. X.501, "The Directory: Models", 1993. 2029 [X.511] ITU-T Rec. X.511, "The Directory: Abstract Service 2030 Definition", 1993. 2032 9. Informative References 2034 [CERT] The CERT(R) Center, http://www.cert.org 2036 [PortReg] IANA, "Port Numbers", 2037 http://www.iana.org/assignments/port-numbers 2039 10. IANA Considerations 2041 It is requested that the Internet Assigned Numbers Authority (IANA) 2042 update the LDAP result code registry to indicate that this document 2043 provides the definitive technical specification for result codes 0- 2044 36, 48-54, 64-70, 80-90. 2046 It is requested that the IANA update the LDAP Protocol Mechanism 2047 registry to indicate that this document and [AuthMeth] provides the 2048 definitive technical specification for the Start TLS 2049 (1.3.6.1.4.1.1466.20037) extended operation. 2051 It is requested that the IANA update the occurrence of "RFC XXXX" in 2052 Appendix B with this RFC number at publication. 2054 11. Editor's Address 2056 Jim Sermersheim 2057 Novell, Inc. 2058 1800 South Novell Place 2059 Provo, Utah 84606, USA 2060 jimse@novell.com 2061 +1 801 861-3088 2062 Lightweight Directory Access Protocol Version 3 2064 Appendix A - LDAP Result Codes 2066 This normative appendix details additional considerations regarding 2067 LDAP result codes and provides a brief, general description of each 2068 LDAP result code enumerated in Section 4.1.9. 2070 Additional result codes MAY be defined for use with extensions 2071 [LDAPIANA]. Client implementations SHALL treat any result code which 2072 they do not recognize as an unknown error condition. 2074 A.1 Non-Error Result Codes 2076 These result codes (called "non-error" result codes) do not indicate 2077 an error condition: 2078 success (0), 2079 compareTrue (6), 2080 compareFalse (7), 2081 referral (10), and 2082 saslBindInProgress (14). 2084 The success, compareTrue, and compareFalse result codes indicate 2085 successful completion (and, hence, are referred to as "successful" 2086 result codes). 2088 The referral and saslBindInProgress result codes indicate the client 2089 is required to take additional action to complete the operation. 2091 A.2 Result Codes 2093 Existing LDAP result codes are described as follows: 2095 success (0) 2096 Indicates the successful completion of an operation. Note: 2097 this code is not used with the compare operation. See 2098 compareTrue (5) and compareFalse (6). 2100 operationsError (1) 2101 Indicates that the operation is not properly sequenced with 2102 relation to other operations (of same or different type). 2104 For example, this code is returned if the client attempts to 2105 StartTLS [TLS] while there are other operations outstanding 2106 or if TLS was already established. 2108 protocolError (2) 2109 Indicates the server received data which has incorrect 2110 structure. 2112 For bind operation only, this code is also used to indicate 2113 that the server does not support the requested protocol 2114 version. 2116 Lightweight Directory Access Protocol Version 3 2118 timeLimitExceeded (3) 2119 Indicates that the time limit specified by the client was 2120 exceeded before the operation could be completed. 2122 sizeLimitExceeded (4) 2123 Indicates that the size limit specified by the client was 2124 exceeded before the operation could be completed. 2126 compareFalse (5) 2127 Indicates that the compare operation has successfully 2128 completed and the assertion has evaluated to FALSE. 2130 compareTrue (6) 2131 Indicates that the compare operation has successfully 2132 completed and the assertion has evaluated to TRUE. 2134 authMethodNotSupported (7) 2135 Indicates that the authentication method or mechanism is not 2136 supported. 2138 strongAuthRequired (8) 2139 Indicates that the server has detected that an established 2140 security association between the client and server has 2141 unexpectedly failed or been compromised, or that the server 2142 now requires the client to authenticate using a strong(er) 2143 mechanism. 2145 referral (10) 2146 Indicates that a referral needs to be chased to complete the 2147 operation (see Section 4.1.10). 2149 adminLimitExceeded (11) 2150 Indicates that an administrative limit has been exceeded. 2152 unavailableCriticalExtension (12) 2153 Indicates that the server is unable or unwilling to perform a 2154 critical control (see Section 4.1.11). 2156 confidentialityRequired (13) 2157 Indicates that data confidentiality protections are required. 2159 saslBindInProgress (14) 2160 Indicates the server requires the client to send a new bind 2161 request, with the same SASL mechanism, to continue the 2162 authentication process (see Section 4.2). 2164 noSuchAttribute (16) 2165 Indicates that the named entry does not contain the specified 2166 attribute or attribute value. 2168 undefinedAttributeType (17) 2169 Indicates that a request field contains an unrecognized 2170 attribute description. 2172 Lightweight Directory Access Protocol Version 3 2174 inappropriateMatching (18) 2175 Indicates that an attempt was made, e.g. in an assertion, to 2176 use a matching rule not defined for the attribute type 2177 concerned. 2179 constraintViolation (19) 2180 Indicates that the client supplied an attribute value which 2181 does not conform to the constraints placed upon it by the 2182 data model. 2184 For example, this code is returned when multiple values are 2185 supplied to an attribute which has a SINGLE-VALUE constraint. 2187 attributeOrValueExists (20) 2188 Indicates that the client supplied an attribute or value to 2189 be added to an entry, but the attribute or value already 2190 exists. 2192 invalidAttributeSyntax (21) 2193 Indicates that a purported attribute value does not conform 2194 to the syntax of the attribute. 2196 noSuchObject (32) 2197 Indicates that the object does not exist in the DIT. 2199 aliasProblem (33) 2200 Indicates that an alias problem has occurred. For example, 2201 the code may used to indicate an alias has been dereferenced 2202 which names no object. 2204 invalidDNSyntax (34) 2205 Indicates that an LDAPDN or RelativeLDAPDN field (e.g. search 2206 base, target entry, ModifyDN newrdn, etc.) of a request does 2207 not conform to the required syntax or contains attribute 2208 values which do not conform to the syntax of the attribute's 2209 type. 2211 aliasDereferencingProblem (36) 2212 Indicates that a problem occurred while dereferencing an 2213 alias. Typically an alias was encountered in a situation 2214 where it was not allowed or where access was denied. 2216 inappropriateAuthentication (48) 2217 Indicates the server requires the client which had attempted 2218 to bind anonymously or without supplying credentials to 2219 provide some form of credentials. 2221 invalidCredentials (49) 2222 Indicates that the provided credentials (e.g. the user's name 2223 and password) are invalid. 2225 insufficientAccessRights (50) 2226 Indicates that the client does not have sufficient access 2227 rights to perform the operation. 2229 Lightweight Directory Access Protocol Version 3 2231 busy (51) 2232 Indicates that the server is too busy to service the 2233 operation. 2235 unavailable (52) 2236 Indicates that the server is shutting down or a subsystem 2237 necessary to complete the operation is offline. 2239 unwillingToPerform (53) 2240 Indicates that the server is unwilling to perform the 2241 operation. 2243 loopDetect (54) 2244 Indicates that the server has detected an internal loop. 2246 namingViolation (64) 2247 Indicates that the entry's name violates naming restrictions. 2249 objectClassViolation (65) 2250 Indicates that the entry violates object class restrictions. 2252 notAllowedOnNonLeaf (66) 2253 Indicates that the operation is inappropriately acting upon a 2254 non-leaf entry. 2256 notAllowedOnRDN (67) 2257 Indicates that the operation is inappropriately attempting to 2258 remove a value which forms the entry's relative distinguished 2259 name. 2261 entryAlreadyExists (68) 2262 Indicates that the request cannot be fulfilled (added, moved, 2263 or renamed) as the target entry already exists. 2265 objectClassModsProhibited (69) 2266 Indicates that an attempt to modify the object class(es) of 2267 an entry's 'objectClass' attribute is prohibited. 2269 For example, this code is returned when a client attempts to 2270 modify the structural object class of an entry. 2272 affectsMultipleDSAs (71) 2273 Indicates that the operation cannot be completed as it 2274 affects multiple servers (DSAs). 2276 other (80) 2277 Indicates the server has encountered an internal error. 2279 Lightweight Directory Access Protocol Version 3 2281 Appendix B - Complete ASN.1 Definition 2283 This appendix is normative. 2285 Lightweight-Directory-Access-Protocol-V3 2286 -- Copyright (C) The Internet Society (2003). This version of 2287 -- this ASN.1 module is part of RFC XXXX; see the RFC itself 2288 -- for full legal notices. 2289 DEFINITIONS 2290 IMPLICIT TAGS 2291 EXTENSIBILITY IMPLIED ::= 2293 BEGIN 2295 LDAPMessage ::= SEQUENCE { 2296 messageID MessageID, 2297 protocolOp CHOICE { 2298 bindRequest BindRequest, 2299 bindResponse BindResponse, 2300 unbindRequest UnbindRequest, 2301 searchRequest SearchRequest, 2302 searchResEntry SearchResultEntry, 2303 searchResDone SearchResultDone, 2304 searchResRef SearchResultReference, 2305 modifyRequest ModifyRequest, 2306 modifyResponse ModifyResponse, 2307 addRequest AddRequest, 2308 addResponse AddResponse, 2309 delRequest DelRequest, 2310 delResponse DelResponse, 2311 modDNRequest ModifyDNRequest, 2312 modDNResponse ModifyDNResponse, 2313 compareRequest CompareRequest, 2314 compareResponse CompareResponse, 2315 abandonRequest AbandonRequest, 2316 extendedReq ExtendedRequest, 2317 extendedResp ExtendedResponse, 2318 ... }, 2319 controls [0] Controls OPTIONAL } 2321 MessageID ::= INTEGER (0 .. maxInt) 2323 maxInt INTEGER ::= 2147483647 -- (2^^31 - 1) -- 2325 LDAPString ::= OCTET STRING -- UTF-8 encoded, 2326 -- [ISO10646] characters 2328 LDAPOID ::= OCTET STRING -- Constrained to [Models] 2330 LDAPDN ::= LDAPString -- Constrained to 2331 -- [LDAPDN] 2333 RelativeLDAPDN ::= LDAPString -- Constrained to 2334 -- [LDAPDN] 2335 Lightweight Directory Access Protocol Version 3 2337 AttributeDescription ::= LDAPString 2338 -- Constrained to 2339 -- [Models] 2341 AttributeValue ::= OCTET STRING 2343 AttributeValueAssertion ::= SEQUENCE { 2344 attributeDesc AttributeDescription, 2345 assertionValue AssertionValue } 2347 AssertionValue ::= OCTET STRING 2349 PartialAttribute ::= SEQUENCE { 2350 type AttributeDescription, 2351 vals SET OF value AttributeValue } 2353 Attribute ::= PartialAttribute(WITH COMPONENTS { 2354 ..., 2355 vals (SIZE(1..MAX))}) 2357 MatchingRuleId ::= LDAPString 2359 LDAPResult ::= SEQUENCE { 2360 resultCode ENUMERATED { 2361 success (0), 2362 operationsError (1), 2363 protocolError (2), 2364 timeLimitExceeded (3), 2365 sizeLimitExceeded (4), 2366 compareFalse (5), 2367 compareTrue (6), 2368 authMethodNotSupported (7), 2369 strongAuthRequired (8), 2370 -- 9 reserved -- 2371 referral (10), 2372 adminLimitExceeded (11), 2373 unavailableCriticalExtension (12), 2374 confidentialityRequired (13), 2375 saslBindInProgress (14), 2376 noSuchAttribute (16), 2377 undefinedAttributeType (17), 2378 inappropriateMatching (18), 2379 constraintViolation (19), 2380 attributeOrValueExists (20), 2381 invalidAttributeSyntax (21), 2382 -- 22-31 unused -- 2383 noSuchObject (32), 2384 aliasProblem (33), 2385 invalidDNSyntax (34), 2386 -- 35 reserved for undefined isLeaf -- 2387 aliasDereferencingProblem (36), 2388 -- 37-47 unused -- 2389 inappropriateAuthentication (48), 2390 Lightweight Directory Access Protocol Version 3 2392 invalidCredentials (49), 2393 insufficientAccessRights (50), 2394 busy (51), 2395 unavailable (52), 2396 unwillingToPerform (53), 2397 loopDetect (54), 2398 -- 55-63 unused -- 2399 namingViolation (64), 2400 objectClassViolation (65), 2401 notAllowedOnNonLeaf (66), 2402 notAllowedOnRDN (67), 2403 entryAlreadyExists (68), 2404 objectClassModsProhibited (69), 2405 -- 70 reserved for CLDAP -- 2406 affectsMultipleDSAs (71), 2407 -- 72-79 unused -- 2408 other (80), 2409 ... }, 2410 matchedDN LDAPDN, 2411 diagnosticMessage LDAPString, 2412 referral [3] Referral OPTIONAL } 2414 Referral ::= SEQUENCE SIZE (1..MAX) OF uri URI 2416 URI ::= LDAPString -- limited to characters permitted in 2417 -- URIs 2419 Controls ::= SEQUENCE OF control Control 2421 Control ::= SEQUENCE { 2422 controlType LDAPOID, 2423 criticality BOOLEAN DEFAULT FALSE, 2424 controlValue OCTET STRING OPTIONAL } 2426 BindRequest ::= [APPLICATION 0] SEQUENCE { 2427 version INTEGER (1 .. 127), 2428 name LDAPDN, 2429 authentication AuthenticationChoice } 2431 AuthenticationChoice ::= CHOICE { 2432 simple [0] OCTET STRING, 2433 -- 1 and 2 reserved 2434 sasl [3] SaslCredentials, 2435 ... } 2437 SaslCredentials ::= SEQUENCE { 2438 mechanism LDAPString, 2439 credentials OCTET STRING OPTIONAL } 2441 BindResponse ::= [APPLICATION 1] SEQUENCE { 2442 COMPONENTS OF LDAPResult, 2443 serverSaslCreds [7] OCTET STRING OPTIONAL } 2445 UnbindRequest ::= [APPLICATION 2] NULL 2446 Lightweight Directory Access Protocol Version 3 2448 SearchRequest ::= [APPLICATION 3] SEQUENCE { 2449 baseObject LDAPDN, 2450 scope ENUMERATED { 2451 baseObject (0), 2452 singleLevel (1), 2453 wholeSubtree (2) }, 2454 derefAliases ENUMERATED { 2455 neverDerefAliases (0), 2456 derefInSearching (1), 2457 derefFindingBaseObj (2), 2458 derefAlways (3) }, 2459 sizeLimit INTEGER (0 .. maxInt), 2460 timeLimit INTEGER (0 .. maxInt), 2461 typesOnly BOOLEAN, 2462 filter Filter, 2463 attributes AttributeSelection } 2465 AttributeSelection ::= SEQUENCE OF selection LDAPString 2466 -- constrained to 2467 -- in section 4.5.1. 2469 Filter ::= CHOICE { 2470 and [0] SET SIZE (1..MAX) OF filter Filter, 2471 or [1] SET SIZE (1..MAX) OF filter Filter, 2472 not [2] Filter, 2473 equalityMatch [3] AttributeValueAssertion, 2474 substrings [4] SubstringFilter, 2475 greaterOrEqual [5] AttributeValueAssertion, 2476 lessOrEqual [6] AttributeValueAssertion, 2477 present [7] AttributeDescription, 2478 approxMatch [8] AttributeValueAssertion, 2479 extensibleMatch [9] MatchingRuleAssertion } 2481 SubstringFilter ::= SEQUENCE { 2482 type AttributeDescription, 2483 -- at least one must be present, 2484 -- initial and final can occur at most once 2485 substrings SEQUENCE SIZE (1..MAX) OF substring CHOICE { 2486 initial [0] AssertionValue, 2487 any [1] AssertionValue, 2488 final [2] AssertionValue } } 2490 MatchingRuleAssertion ::= SEQUENCE { 2491 matchingRule [1] MatchingRuleId OPTIONAL, 2492 type [2] AttributeDescription OPTIONAL, 2493 matchValue [3] AssertionValue, 2494 dnAttributes [4] BOOLEAN DEFAULT FALSE } 2496 SearchResultEntry ::= [APPLICATION 4] SEQUENCE { 2497 objectName LDAPDN, 2498 attributes PartialAttributeList } 2500 PartialAttributeList ::= SEQUENCE OF 2501 Lightweight Directory Access Protocol Version 3 2503 partialAttribute PartialAttribute 2505 SearchResultReference ::= [APPLICATION 19] SEQUENCE 2506 SIZE (1..MAX) OF uri URI 2508 SearchResultDone ::= [APPLICATION 5] LDAPResult 2510 ModifyRequest ::= [APPLICATION 6] SEQUENCE { 2511 object LDAPDN, 2512 changes SEQUENCE OF change SEQUENCE { 2513 operation ENUMERATED { 2514 add (0), 2515 delete (1), 2516 replace (2) }, 2517 modification PartialAttribute } } 2519 ModifyResponse ::= [APPLICATION 7] LDAPResult 2521 AddRequest ::= [APPLICATION 8] SEQUENCE { 2522 entry LDAPDN, 2523 attributes AttributeList } 2525 AttributeList ::= SEQUENCE OF attribute Attribute 2527 AddResponse ::= [APPLICATION 9] LDAPResult 2529 DelRequest ::= [APPLICATION 10] LDAPDN 2531 DelResponse ::= [APPLICATION 11] LDAPResult 2533 ModifyDNRequest ::= [APPLICATION 12] SEQUENCE { 2534 entry LDAPDN, 2535 newrdn RelativeLDAPDN, 2536 deleteoldrdn BOOLEAN, 2537 newSuperior [0] LDAPDN OPTIONAL } 2539 ModifyDNResponse ::= [APPLICATION 13] LDAPResult 2541 CompareRequest ::= [APPLICATION 14] SEQUENCE { 2542 entry LDAPDN, 2543 ava AttributeValueAssertion } 2545 CompareResponse ::= [APPLICATION 15] LDAPResult 2547 AbandonRequest ::= [APPLICATION 16] MessageID 2549 ExtendedRequest ::= [APPLICATION 23] SEQUENCE { 2550 requestName [0] LDAPOID, 2551 requestValue [1] OCTET STRING OPTIONAL } 2553 ExtendedResponse ::= [APPLICATION 24] SEQUENCE { 2554 COMPONENTS OF LDAPResult, 2555 responseName [10] LDAPOID OPTIONAL, 2556 responseValue [11] OCTET STRING OPTIONAL } 2557 Lightweight Directory Access Protocol Version 3 2559 END 2560 Lightweight Directory Access Protocol Version 3 2562 Appendix C - Changes 2564 This appendix is non-normative. 2566 This appendix summarizes substantive changes made to RFC 2251 and RFC 2567 2830. 2569 C.1 Changes made to made to RFC 2251: 2571 This section summarizes the substantive changes made to Sections 1, 2572 2, 3.1, and 4 through the remainder of RFC 2251. Readers should 2573 consult [Models] and [AuthMeth] for summaries of changes to other 2574 sections. 2576 C.1.1 Section 1 2578 - Removed IESG note. Post publication of RFC 2251, mandatory LDAP 2579 authentication mechanisms have been standardized which are 2580 sufficient to remove this note. See [AuthMeth] for authentication 2581 mechanisms. 2583 C.1.2 Section 3.1 and others 2585 - Removed notes giving history between LDAP v1, v2 and v3. Instead, 2586 added sufficient language so that this document can stand on its 2587 own. 2589 C.1.3 Section 4 2591 - Clarified where the extensibility features of ASN.1 apply to the 2592 protocol. This change also affected various ASN.1 types. 2593 - Removed the requirement that servers which implement version 3 or 2594 later MUST provide the 'supportedLDAPVersion' attribute. This 2595 statement provided no interoperability advantages. 2597 C.1.4 Section 4.1.1 2599 - There was a mandatory requirement for the server to return a 2600 Notice of Disconnection and drop the connection when a PDU is 2601 malformed in a certain way. This has been clarified such that the 2602 server SHOULD return the Notice of Disconnection, and MUST drop 2603 the connection. 2605 C.1.5 Section 4.1.1.1 2607 - Clarified that the messageID of requests MUST be non-zero. 2609 Lightweight Directory Access Protocol Version 3 2611 - Clarified when it is and isn't appropriate to return an already 2612 used message id. RFC 2251 accidentally imposed synchronous server 2613 behavior in its wording of this. 2615 C.1.6 Section 4.1.2 2617 - Stated that LDAPOID is constrained to from [Models]. 2619 C.1.7 Section 4.1.5.1 2621 - Removed the Binary Option from the specification. There are 2622 numerous interoperability problems associated with this method of 2623 alternate attribute type encoding. Work to specify a suitable 2624 replacement is ongoing. 2626 C.1.8 Section 4.1.6 2628 - Removed references to the "binary" encoding as it has been removed 2629 from the specification. 2631 C.1.9 Section 4.1.7 2633 - Removed references to the "binary" encoding as it has been removed 2634 from the specification. 2636 C.1.10 Section 4.1.8 2638 - Combined the definitions of PartialAttribute and Attribute here, 2639 and defined Attribute in terms of PartialAttribute. 2641 C.1.11 Section 4.1.10 2643 - Renamed "errorMessage" to "diagnosticMessage" as it is allowed to 2644 be sent for non-error results. 2645 - Moved some language into Appendix A, and refer the reader there. 2646 - Allowed matchedDN to be present for other result codes than those 2647 listed in RFC 2251. 2649 C.1.12 Section 4.1.11 2651 - Defined referrals in terms of URIs rather than URLs. 2652 - Removed the requirement that all referral URIs MUST be equally 2653 capable of progressing the operation. The statement was ambiguous 2654 and provided no instructions on how to carry it out. 2655 - Added the requirement that clients MUST NOT loop between servers. 2656 - Clarified the instructions for using LDAPURLs in referrals, and in 2657 doing so added a recommendation that the scope part be present. 2659 Lightweight Directory Access Protocol Version 3 2661 C.1.13 Section 4.1.12 2663 - Specified how control values defined in terms of ASN.1 are to be 2664 encoded. 2665 - Noted that the criticality field is only applied to request 2666 messages (except unbindRequest). 2667 - Added language regarding combinations of controls on a message. 2668 - Changed "The server MUST be prepared" to "Implementations MUST be 2669 prepared" in the eighth paragraph to reflect that both client and 2670 server implementations must be able to handle this (as both parse 2671 controls). 2673 C.1.14 Section 4.2 2675 - Mandated that servers return protocolError when the version is not 2676 supported. 2677 - Clarified behavior when the simple authentication is used, the 2678 name is empty and the password is non-empty. 2679 - Required servers to not dereference aliases for bind. This was 2680 added for consistency with other operations and to help ensure 2681 data consistency. 2682 - Required that textual passwords be transferred as UTF-8 encoded 2683 Unicode, and added recommendations on string preparation. This was 2684 to help ensure interoperability of passwords being sent from 2685 different clients. 2687 C.1.15 Section 4.2.1 2689 - This section was largely reorganized for readability and language 2690 was added to clarify the authentication state of failed and 2691 abandoned bind operations. 2692 - Removed: "If a SASL transfer encryption or integrity mechanism has 2693 been negotiated, that mechanism does not support the changing of 2694 credentials from one identity to another, then the client MUST 2695 instead establish a new connection." 2696 Each SASL negotiation is, generally, independent of other SASL 2697 negotiations. If there were dependencies between multiple 2698 negotiations of a particular mechanism, the mechanism technical 2699 specification should detail how applications are to deal with 2700 them. LDAP should not require any special handling. And if an LDAP 2701 client had used such a mechanism, it would have the option of 2702 using another mechanism. 2703 - Dropped MUST imperative in paragraph 3 to align with [Keywords]. 2705 C.1.16 Section 4.2.3 2707 - Moved most error-related text to Appendix A, and added text 2708 regarding certain errors used in conjunction with the bind 2709 operation. 2711 Lightweight Directory Access Protocol Version 3 2713 - Prohibited the server from specifying serverSaslCreds when not 2714 appropriate. 2716 C.1.17 Section 4.3 2718 - Required both peers to cease transmission and close the connection 2719 for the unbind operation. 2721 C.1.18 Section 4.4 2723 - Added instructions for future specifications of Unsolicited 2724 Notifications. 2726 C.1.19 Section 4.5.1 2728 - SearchRequest attributes is now defined as an AttributeSelection 2729 type rather than AttributeDescriptionList. 2730 - The Filter choices 'and' and 'or', and the SubstringFilter 2731 substrings types are now defined with a lower bound of 1. 2732 - The SubstringFilter substrings 'initial, 'any', and 'final' types 2733 are now AssertionValue rather than LDAPString. Also, added 2734 imperatives stating that 'initial' (if present) must be listed 2735 first, and 'final' (if present) must be listed last. 2736 - Clarified the semantics of the derefAliases choices. 2737 - Added instructions for equalityMatch, substrings, greaterOrEqual, 2738 lessOrEqual, and approxMatch. 2740 C.1.20 Section 4.5.2 2742 - Recommended that servers not use attribute short names when it 2743 knows they are ambiguous or may cause interoperability problems. 2744 - Removed all mention of ExtendedResponse due to lack of 2745 implementation. 2747 C.1.21 Section 4.5.3 2749 - Made changes similar to those made to Section 4.1.11. 2751 C.1.22 Section 4.5.3.1 2753 - Fixed examples to adhere to changes made to Section 4.5.3. 2755 C.1.23 Section 4.6 2757 - Removed restriction that required an EQUALITY matching rule in 2758 order to perform value delete modifications. It is sufficiently 2759 Lightweight Directory Access Protocol Version 3 2761 documented that in absence of an equality matching rule, octet 2762 equality is used. 2763 - Replaced AttributeTypeAndValues with Attribute as they are 2764 equivalent. 2765 - Clarified what type of modification changes might temporarily 2766 violate schema. 2768 C.1.24 Section 4.9 2770 - Required servers to not dereference aliases for modify DN. This 2771 was added for consistency with other operations and to help ensure 2772 data consistency. 2773 - Allow modify DN to fail when moving between naming contexts. 2775 C.1.25 Section 4.10 2777 - Clarified the semantics of Compare when the attribute is not 2778 present and when it is unknown. 2779 - Required servers to not dereference aliases for compare. This was 2780 added for consistency with other operations and to help ensure 2781 data consistency. 2783 C.1.26 Section 4.11 2785 - Explained that since abandon returns no response, clients should 2786 not use it if they need to know the outcome. 2787 - Specified that Abandon and Unbind cannot be abandoned. 2789 C.1.27 Section 4.12 2791 - Specified how values of extended operations defined in terms of 2792 ASN.1 are to be encoded. 2793 - Added instructions on what extended operation specifications 2794 consist of. 2795 - Added a recommendation that servers advertise supported extended 2796 operations. 2798 C.1.28 Section 5.2 2800 - Moved referral-specific instructions into referral-related 2801 sections. 2803 C.1.29 Section 7 2805 - Reworded notes regarding SASL not protecting certain aspects of 2806 the LDAP bind PDU. 2808 Lightweight Directory Access Protocol Version 3 2810 - Noted that Servers are encouraged to prevent directory 2811 modifications by clients that have authenticated anonymously 2812 [AuthMeth]. 2813 - Added a note regarding the scenario where an identity is changed 2814 (deleted, privileges or credentials modified, etc.). 2815 - Warned against following referrals that may have been injected in 2816 the data stream. 2817 - Added a note regarding malformed and long encodings. 2819 C.1.30 Appendix A 2821 - Added "EXTESIBILITY IMPLIED" to ASN.1 definition. 2822 - Removed AttributeType. It is not used. 2824 C.2 Changes made to made to RFC 2830: 2826 This section summarizes the substantive changes made to Sections of 2827 RFC 2830. Readers should consult [AuthMeth] for summaries of changes 2828 to other sections. 2830 C.2.1 Section 2.3 2832 - Removed wording indicating that referrals can be returned from 2833 StartTLS 2834 - Removed requirement that only a narrow set of result codes can be 2835 returned. Some result codes are required in certain scenarios, but 2836 any other may be returned if appropriate. 2838 C.2.1 Section 4.13.3.1 2840 - Reworded most of this section and added the requirement that after 2841 the TLS connection has been closed, the server MUST NOT send 2842 responses to any request message received before the TLS closure. 2844 Lightweight Directory Access Protocol Version 3 2846 Intellectual Property Rights 2848 The IETF takes no position regarding the validity or scope of any 2849 intellectual property or other rights that might be claimed to 2850 pertain to the implementation or use of the technology described in 2851 this document or the extent to which any license under such rights 2852 might or might not be available; neither does it represent that it 2853 has made any effort to identify any such rights. Information on the 2854 IETF's procedures with respect to rights in standards-track and 2855 standards-related documentation can be found in BCP-11. Copies of 2856 claims of rights made available for publication and any assurances of 2857 licenses to be made available, or the result of an attempt made to 2858 obtain a general license or permission for the use of such 2859 proprietary rights by implementors or users of this specification can 2860 be obtained from the IETF Secretariat. 2862 The IETF invites any interested party to bring to its attention any 2863 copyrights, patents or patent applications, or other proprietary 2864 rights which may cover technology that may be required to practice 2865 this standard. Please address the information to the IETF Executive 2866 Director. 2868 Full Copyright Statement 2870 Copyright (C) The Internet Society (2003). All Rights Reserved. 2872 This document and translations of it may be copied and furnished to 2873 others, and derivative works that comment on or otherwise explain it 2874 or assist in its implementation may be prepared, copied, published 2875 and distributed, in whole or in part, without restriction of any 2876 kind, provided that the above copyright notice and this paragraph are 2877 included on all such copies and derivative works. However, this 2878 document itself may not be modified in any way, such as by removing 2879 the copyright notice or references to the Internet Society or other 2880 Internet organizations, except as needed for the purpose of 2881 developing Internet standards in which case the procedures for 2882 copyrights defined in the Internet Standards process must be 2883 followed, or as required to translate it into languages other than 2884 English. 2886 The limited permissions granted above are perpetual and will not be 2887 revoked by the Internet Society or its successors or assigns. 2889 This document and the information contained herein is provided on an 2890 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 2891 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 2892 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION 2893 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 2894 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.