idnits 2.17.1 draft-ietf-ldapbis-protocol-19.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: ---------------------------------------------------------------------------- == The page length should not exceed 58 lines per page, but there was 1 longer page, the longest (page 20) being 62 lines 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 (Dec 2003) is 7438 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 2508 -- Looks like a reference, but probably isn't: '3' on line 2451 == Missing Reference: 'APPLICATION 0' is mentioned on line 2386, 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 2401, but not defined -- Looks like a reference, but probably isn't: '7' on line 2435 == Missing Reference: 'APPLICATION 2' is mentioned on line 2405, but not defined == Missing Reference: 'APPLICATION 3' is mentioned on line 2408, but not defined -- Looks like a reference, but probably isn't: '1' on line 2509 -- Looks like a reference, but probably isn't: '2' on line 2450 -- Looks like a reference, but probably isn't: '4' on line 2452 -- Looks like a reference, but probably isn't: '5' on line 2433 -- Looks like a reference, but probably isn't: '6' on line 2434 -- Looks like a reference, but probably isn't: '8' on line 2436 -- Looks like a reference, but probably isn't: '9' on line 2437 == Missing Reference: 'APPLICATION 4' is mentioned on line 2454, but not defined == Missing Reference: 'APPLICATION 19' is mentioned on line 2461, but not defined == Missing Reference: 'APPLICATION 5' is mentioned on line 2466, but not defined == Missing Reference: 'APPLICATION 6' is mentioned on line 2468, but not defined == Missing Reference: 'APPLICATION 7' is mentioned on line 2477, but not defined == Missing Reference: 'APPLICATION 8' is mentioned on line 2479, but not defined == Missing Reference: 'APPLICATION 9' is mentioned on line 2485, but not defined == Missing Reference: 'APPLICATION 10' is mentioned on line 2487, but not defined == Missing Reference: 'APPLICATION 11' is mentioned on line 2489, but not defined == Missing Reference: 'APPLICATION 12' is mentioned on line 2491, but not defined == Missing Reference: 'APPLICATION 13' is mentioned on line 2497, but not defined == Missing Reference: 'APPLICATION 14' is mentioned on line 2499, but not defined == Missing Reference: 'APPLICATION 15' is mentioned on line 2503, but not defined == Missing Reference: 'APPLICATION 16' is mentioned on line 2505, but not defined == Missing Reference: 'APPLICATION 23' is mentioned on line 2507, but not defined == Missing Reference: 'APPLICATION 24' is mentioned on line 2511, but not defined -- Looks like a reference, but probably isn't: '10' on line 2513 -- Looks like a reference, but probably isn't: '11' on line 2514 == Missing Reference: 'RFC2246' is mentioned on line 2066, but not defined ** Obsolete undefined reference: RFC 2246 (Obsoleted by RFC 4346) == Missing Reference: 'Keywords' is mentioned on line 2658, but not defined == Unused Reference: 'ABNF' is defined on line 1915, but no explicit reference was found in the text == Unused Reference: 'IP' is defined on line 1932, but no explicit reference was found in the text == Unused Reference: 'SASLPrep' is defined on line 1963, but no explicit reference was found in the text == Unused Reference: 'StringPrep' is defined on line 1967, 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: 5 errors (**), 0 flaws (~~), 33 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-19.txt Dec 2003 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.....................................16 65 4.5. Search Operation.............................................17 66 4.6. Modify Operation.............................................25 67 4.7. Add Operation................................................26 68 4.8. Delete Operation.............................................27 69 4.9. Modify DN Operation..........................................28 70 4.10. Compare Operation...........................................29 71 4.11. Abandon Operation...........................................30 72 4.12. Extended Operation..........................................30 73 4.13. StartTLS Operation..........................................31 74 5. Protocol Element Encodings and Transfer........................33 75 5.1. Protocol Encoding............................................34 76 5.2. Transfer Protocols...........................................34 77 6. Security Considerations........................................34 78 7. Acknowledgements...............................................36 79 8. Normative References...........................................36 80 9. Informative References.........................................37 81 10. IANA Considerations...........................................37 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..............................................48 88 C.1 Changes made to made to RFC 2251:.............................48 89 C.2 Changes made to made to RFC 2830:.............................53 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 connection. 139 The terms "association" and "LDAP association" both refer to the 140 association of the LDAP connection and its current authentication and 141 authorization state. 143 3. Protocol Model 145 The general model adopted by this protocol is one of clients 146 performing protocol operations against servers. In this model, a 147 client transmits a protocol request describing the operation to be 148 performed to a server. The server is then responsible for performing 149 the necessary operation(s) in the Directory. Upon completion of the 150 operation(s), the server returns a response containing an appropriate 151 result code to the requesting client. 153 Although servers are required to return responses whenever such 154 responses are defined in the protocol, there is no requirement for 155 synchronous behavior on the part of either clients or servers. 156 Requests and responses for multiple operations may be exchanged 157 between a client and server in any order, provided the client 158 eventually receives a response for every request that requires one. 160 Lightweight Directory Access Protocol Version 3 162 The core protocol operations defined in this document can be mapped 163 to a subset of the X.500 (1993) Directory Abstract Service. However 164 there is not a one-to-one mapping between LDAP protocol operations 165 and X.500 Directory Access Protocol (DAP) operations. Server 166 implementations acting as a gateway to X.500 directories may need to 167 make multiple DAP requests to service a single LDAP request. 169 4. Elements of Protocol 171 The LDAP protocol is described using Abstract Syntax Notation One 172 ([ASN.1]), and is transferred using a subset of ASN.1 Basic Encoding 173 Rules ([BER]). Section 5.1 specifies how the protocol elements are 174 encoded and transferred. 176 In order to support future Standards Track extensions to this 177 protocol, extensibility is implied where it is allowed (per ASN.1). 178 In addition, ellipses (...) have been supplied in ASN.1 types that 179 are explicitly extensible as discussed in [LDAPIANA]. Because of the 180 implied extensibility, clients and servers MUST (unless otherwise 181 specified) ignore trailing SEQUENCE components whose tags they do not 182 recognize. 184 Changes to the LDAP protocol other than through the extension 185 mechanisms described here require a different version number. A 186 client indicates the version it is using as part of the bind request, 187 described in Section 4.2. If a client has not sent a bind, the server 188 MUST assume the client is using version 3 or later. 190 Clients may determine the protocol versions a server supports by 191 reading the supportedLDAPVersion attribute from the root DSE (DSA- 192 Specific Entry) [Models]. 194 4.1. Common Elements 196 This section describes the LDAPMessage envelope Protocol Data Unit 197 (PDU) format, as well as data type definitions, which are used in the 198 protocol operations. 200 4.1.1. Message Envelope 202 For the purposes of protocol exchanges, all protocol operations are 203 encapsulated in a common envelope, the LDAPMessage, which is defined 204 as follows: 206 LDAPMessage ::= SEQUENCE { 207 messageID MessageID, 208 protocolOp CHOICE { 209 bindRequest BindRequest, 210 bindResponse BindResponse, 211 unbindRequest UnbindRequest, 212 Lightweight Directory Access Protocol Version 3 214 searchRequest SearchRequest, 215 searchResEntry SearchResultEntry, 216 searchResDone SearchResultDone, 217 searchResRef SearchResultReference, 218 modifyRequest ModifyRequest, 219 modifyResponse ModifyResponse, 220 addRequest AddRequest, 221 addResponse AddResponse, 222 delRequest DelRequest, 223 delResponse DelResponse, 224 modDNRequest ModifyDNRequest, 225 modDNResponse ModifyDNResponse, 226 compareRequest CompareRequest, 227 compareResponse CompareResponse, 228 abandonRequest AbandonRequest, 229 extendedReq ExtendedRequest, 230 extendedResp ExtendedResponse, 231 ... }, 232 controls [0] Controls OPTIONAL } 234 MessageID ::= INTEGER (0 .. maxInt) 236 maxInt INTEGER ::= 2147483647 -- (2^^31 - 1) -- 238 The function of the LDAPMessage is to provide an envelope containing 239 common fields required in all protocol exchanges. At this time the 240 only common fields are the message ID and the controls. 242 If the server receives a PDU from the client in which the LDAPMessage 243 SEQUENCE tag cannot be recognized, the messageID cannot be parsed, 244 the tag of the protocolOp is not recognized as a request, or the 245 encoding structures or lengths of data fields are found to be 246 incorrect, then the server SHOULD return the Notice of Disconnection 247 described in Section 4.4.1, with the resultCode set to protocolError, 248 and MUST immediately close the connection. 250 In other cases where the client or server cannot parse a PDU, it 251 SHOULD abruptly close the connection where further communication 252 (including providing notice) would be pernicious. Otherwise, server 253 implementations MUST return an appropriate response to the request, 254 with the resultCode set to protocolError. 256 The ASN.1 type Controls is defined in Section 4.1.11. 258 4.1.1.1. Message ID 260 All LDAPMessage envelopes encapsulating responses contain the 261 messageID value of the corresponding request LDAPMessage. 263 The message ID of a request MUST have a non-zero value different from 264 the values of any other requests outstanding in the LDAP association 265 of which this message is a part. The zero value is reserved for the 266 unsolicited notification message. 268 Lightweight Directory Access Protocol Version 3 270 Typical clients increment a counter for each request. 272 A client MUST NOT send a request with the same message ID as an 273 earlier request on the same LDAP association unless it can be 274 determined that the server is no longer servicing the earlier 275 request. Otherwise the behavior is undefined. For operations that do 276 not return responses (unbind, abandon, and abandoned operations), the 277 client SHOULD assume the operation is in progress until a subsequent 278 bind request completes. 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.3 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 attributes (e.g. 344 photographs). 346 Attributes may be defined which have arbitrary and non-printable 347 syntax. Implementations MUST NOT display nor attempt to decode a 348 value if its syntax is not known. The implementation may attempt to 349 discover the subschema of the source entry, and retrieve the 350 descriptions of attributeTypes from it [Models]. 352 Clients MUST NOT send attribute values in a request that are not 353 valid according to the syntax defined for the attributes. 355 4.1.6. Attribute Value Assertion 357 The AttributeValueAssertion type definition is similar to the one in 358 the X.500 Directory standards. It contains an attribute description 359 and a matching rule assertion value suitable for that type. 361 AttributeValueAssertion ::= SEQUENCE { 362 attributeDesc AttributeDescription, 363 assertionValue AssertionValue } 365 AssertionValue ::= OCTET STRING 367 The syntax of the AssertionValue depends on the context of the LDAP 368 operation being performed. For example, the syntax of the EQUALITY 369 matching rule for an attribute is used when performing a Compare 370 operation. Often this is the same syntax used for values of the 371 attribute type, but in some cases the assertion syntax differs from 372 Lightweight Directory Access Protocol Version 3 374 the value syntax. See objectIdentiferFirstComponentMatch in 375 [Syntaxes] for an example. 377 4.1.7. Attribute and PartialAttribute 379 Attributes and partial attributes consist of an attribute description 380 and values of that attribute description. A PartialAttribute allows 381 zero values, while Attribute requires at least one value. 383 PartialAttribute ::= SEQUENCE { 384 type AttributeDescription, 385 vals SET OF value AttributeValue } 387 Attribute ::= PartialAttribute(WITH COMPONENTS { 388 ..., 389 vals (SIZE(1..MAX))}) 391 Each attribute value is distinct in the set (no duplicates). The set 392 of attribute values is unordered. Implementations MUST NOT rely upon 393 the ordering being repeatable. 395 4.1.8. Matching Rule Identifier 397 Matching rules are defined in 4.1.3 of [Models]. A matching rule is 398 identified in the LDAP protocol by the printable representation of 399 either its , or one of its short name descriptors 400 [Models], e.g. "caseIgnoreIA5Match" or "1.3.6.1.4.1.453.33.33". 402 MatchingRuleId ::= LDAPString 404 4.1.9. Result Message 406 The LDAPResult is the construct used in this protocol to return 407 success or failure indications from servers to clients. To various 408 requests, servers will return responses of LDAPResult or responses 409 containing the components of LDAPResult to indicate the final status 410 of a protocol operation request. 412 LDAPResult ::= SEQUENCE { 413 resultCode ENUMERATED { 414 success (0), 415 operationsError (1), 416 protocolError (2), 417 timeLimitExceeded (3), 418 sizeLimitExceeded (4), 419 compareFalse (5), 420 compareTrue (6), 421 authMethodNotSupported (7), 422 strongAuthRequired (8), 423 -- 9 reserved -- 424 referral (10), 425 adminLimitExceeded (11), 426 Lightweight Directory Access Protocol Version 3 428 unavailableCriticalExtension (12), 429 confidentialityRequired (13), 430 saslBindInProgress (14), 431 noSuchAttribute (16), 432 undefinedAttributeType (17), 433 inappropriateMatching (18), 434 constraintViolation (19), 435 attributeOrValueExists (20), 436 invalidAttributeSyntax (21), 437 -- 22-31 unused -- 438 noSuchObject (32), 439 aliasProblem (33), 440 invalidDNSyntax (34), 441 -- 35 reserved for undefined isLeaf -- 442 aliasDereferencingProblem (36), 443 -- 37-47 unused -- 444 inappropriateAuthentication (48), 445 invalidCredentials (49), 446 insufficientAccessRights (50), 447 busy (51), 448 unavailable (52), 449 unwillingToPerform (53), 450 loopDetect (54), 451 -- 55-63 unused -- 452 namingViolation (64), 453 objectClassViolation (65), 454 notAllowedOnNonLeaf (66), 455 notAllowedOnRDN (67), 456 entryAlreadyExists (68), 457 objectClassModsProhibited (69), 458 -- 70 reserved for CLDAP -- 459 affectsMultipleDSAs (71), 460 -- 72-79 unused -- 461 other (80), 462 ... }, 463 -- 81-90 reserved for APIs -- 464 matchedDN LDAPDN, 465 diagnosticMessage LDAPString, 466 referral [3] Referral OPTIONAL } 468 The resultCode enumeration is extensible as defined in Section 3.5 of 469 [LDAPIANA]. The meanings of the result codes are given in Appendix A. 470 If a server detects multiple errors for an operation, only one result 471 code is returned. The server should return the result code that best 472 indicates the nature of the error encountered. 474 The diagnosticMessage field of this construct may, at the server's 475 option, be used to return a string containing a textual, human- 476 readable (terminal control and page formatting characters should be 477 avoided) diagnostic message. As this diagnostic message is not 478 standardized, implementations MUST NOT rely on the values returned. 479 If the server chooses not to return a textual diagnostic, the 480 diagnosticMessage field MUST be empty. 482 Lightweight Directory Access Protocol Version 3 484 For certain result codes (typically, but not restricted to 485 noSuchObject, aliasProblem, invalidDNSyntax and 486 aliasDereferencingProblem), the matchedDN field is set to the name of 487 the lowest entry (object or alias) in the Directory that was matched. 488 If no aliases were dereferenced while attempting to locate the entry, 489 this will be a truncated form of the name provided, or if aliases 490 were dereferenced, of the resulting name, as defined in Section 12.5 491 of [X.511]. Otherwise the matchedDN field is empty. 493 4.1.10. Referral 495 The referral result code indicates that the contacted server does not 496 hold the target entry of the request. The referral field is present 497 in an LDAPResult if the resultCode field value is referral, and 498 absent with all other result codes. It contains one or more 499 references to one or more servers or services that may be accessed 500 via LDAP or other protocols. Referrals can be returned in response to 501 any operation request (except unbind and abandon which do not have 502 responses). At least one URI MUST be present in the Referral. 504 During a search operation, after the baseObject is located, and 505 entries are being evaluated, the referral is not returned. Instead, 506 continuation references, described in Section 4.5.3, are returned 507 when the search scope spans multiple naming contexts, and several 508 different servers would need to be contacted to complete the 509 operation. 511 Referral ::= SEQUENCE SIZE (1..MAX) OF uri URI 513 URI ::= LDAPString -- limited to characters permitted in 514 -- URIs 516 If the client wishes to progress the operation, it MUST follow the 517 referral by contacting one of the services. If multiple URIs are 518 present, the client assumes that any URI may be used to progress the 519 operation. 521 Clients that follow referrals MUST ensure that they do not loop 522 between servers. They MUST NOT repeatedly contact the same server for 523 the same request with the same target entry name, scope and filter. 524 Some clients use a counter that is incremented each time referral 525 handling occurs for an operation, and these kinds of clients MUST be 526 able to handle at least ten nested referrals between the root and a 527 leaf entry. 529 A URI for a server implementing LDAP and accessible via [TCP]/[IP] 530 (v4 or v6) is written as an LDAP URL according to [LDAPURL]. 532 When an LDAP URL is used, the following instructions are followed: 533 - If an alias was dereferenced, the part of the URL MUST be 534 present, with the new target object name. Note that UTF-8 535 characters appearing in a DN or search filter may not be legal 536 Lightweight Directory Access Protocol Version 3 538 for URLs (e.g. spaces) and MUST be escaped using the % method in 539 [URI]. 540 - It is RECOMMENDED that the part be present to avoid 541 ambiguity. 542 - If the part is present, the client MUST use this name in 543 its next request to progress the operation, and if it is not 544 present the client will use the same name as in the original 545 request. 546 - Some servers (e.g. participating in distributed indexing) may 547 provide a different filter in a URL of a referral for a search 548 operation. 549 - If the part of the LDAP URL is present, the client MUST 550 use this filter in its next request to progress this search, and 551 if it is not present the client MUST use the same filter as it 552 used for that search. 553 - For search, it is RECOMMENDED that the part be present 554 to avoid ambiguity. 555 - If the part is missing, the scope of the original search 556 is used by the client to progress the operation. 557 - Other aspects of the new request may be the same as or different 558 from the request which generated the referral. 560 Other kinds of URIs may be returned. The syntax and semantics of such 561 URIs is left to future specifications. Clients ignore URIs that they 562 do not support. 564 4.1.11. Controls 566 A control is a way to specify extension information for an LDAP 567 message. A control only alters the semantics of the message it is 568 attached to. 570 Controls ::= SEQUENCE OF control Control 572 Control ::= SEQUENCE { 573 controlType LDAPOID, 574 criticality BOOLEAN DEFAULT FALSE, 575 controlValue OCTET STRING OPTIONAL } 577 The controlType field is the UTF-8 encoded dotted-decimal 578 representation of an OBJECT IDENTIFIER which uniquely identifies the 579 control, or the request control and its paired response control. This 580 prevents conflicts between control names. 582 The criticality field is either TRUE or FALSE and only applies to 583 request messages that have a corresponding response message. For all 584 other messages (such as abandonRequest, unbindRequest and all 585 response messages), the criticality field SHOULD be FALSE. 587 If the server recognizes the control type and it is appropriate for 588 the operation, the server will make use of the control when 589 performing the operation. 591 Lightweight Directory Access Protocol Version 3 593 If the server does not recognize the control type or it is not 594 appropriate for the operation, and the criticality field is TRUE, the 595 server MUST NOT perform the operation, and for operations that have a 596 response, MUST set the resultCode to unavailableCriticalExtension. 598 If the control is unrecognized or inappropriate but the criticality 599 field is FALSE, the server MUST ignore the control. 601 The controlValue contains any information associated with the 602 control. Its format is defined by the specification of the control. 603 Implementations MUST be prepared to handle arbitrary contents of the 604 controlValue octet string, including zero bytes. It is absent only if 605 there is no value information which is associated with a control of 606 its type. controlValues that are defined in terms of ASN.1 and BER 607 encoded according to Section 5.1, also follow the extensibility rules 608 in Section 4. 610 Servers list the controlType of all request controls they recognize 611 in the supportedControl attribute [Models] in the root DSE. 613 Controls SHOULD NOT be combined unless the semantics of the 614 combination has been specified. The semantics of control 615 combinations, if specified, are generally found in the control 616 specification most recently published. In the absence of combination 617 semantics, the behavior of the operation is undefined. 618 Additionally, unless order-dependent semantics are given in a 619 specification, the order of a combination of controls in the SEQUENCE 620 is ignored. 622 This document does not specify any controls. Controls may be 623 specified in other documents. The specification of a control consists 624 of: 626 - the OBJECT IDENTIFIER assigned to the control, 628 - whether the control is always non critical, always critical, or 629 optionally critical, 631 - whether there is information associated with the control, and if 632 so, the format of the controlValue contents, 634 - the semantics of the control, and 636 - optionally, semantics regarding the combination of the control 637 with other controls. 639 4.2. Bind Operation 641 The function of the Bind Operation is to allow authentication 642 information to be exchanged between the client and server. The Bind 643 operation should be thought of as the "authenticate" operation. 644 Authentication and security-related semantics of this operation are 645 given in [AuthMeth]. 647 Lightweight Directory Access Protocol Version 3 649 The Bind Request is defined as follows: 651 BindRequest ::= [APPLICATION 0] SEQUENCE { 652 version INTEGER (1 .. 127), 653 name LDAPDN, 654 authentication AuthenticationChoice } 656 AuthenticationChoice ::= CHOICE { 657 simple [0] OCTET STRING, 658 -- 1 and 2 reserved 659 sasl [3] SaslCredentials, 660 ... } 662 SaslCredentials ::= SEQUENCE { 663 mechanism LDAPString, 664 credentials OCTET STRING OPTIONAL } 666 Parameters of the Bind Request are: 668 - version: A version number indicating the version of the protocol 669 to be used in this protocol association. This document describes 670 version 3 of the LDAP protocol. Note that there is no version 671 negotiation. The client sets this parameter to the version it 672 desires. If the server does not support the specified version, it 673 MUST respond with protocolError in the resultCode field of the 674 BindResponse. 676 - name: The name of the Directory object that the client wishes to 677 bind as. This field may take on a null value (a zero length 678 string) for the purposes of anonymous binds ([AuthMeth] Section 7) 679 or when using Simple Authentication and Security Layer [SASL] 680 authentication ([AuthMeth] Section 4.3). Server behavior is 681 undefined when the name is a null value, simple authentication is 682 used, and a password is specified. The server SHALL NOT perform 683 alias dereferencing in determining the object to bind as. 685 - authentication: information used to authenticate the name, if any, 686 provided in the Bind Request. This type is extensible as defined 687 in Section 3.6 of [LDAPIANA]. Servers that do not support a choice 688 supplied by a client will return authMethodNotSupported in the 689 resultCode field of the BindResponse. 690 The simple form of an AuthenticationChoice specifies a simple 691 password to be used for authentication. 692 Textual passwords (consisting of a character sequence with a known 693 character set and encoding) SHALL be transferred as [UTF-8] 694 encoded [Unicode]. The determination of whether a password is 695 textual is a local client matter. 696 Prior to transfer, clients SHOULD prepare text passwords by 697 applying the [SASLprep] profile of the [Stringprep] algorithm. 698 Passwords consisting of other data (such as random octets) MUST 699 NOT be altered. 701 Lightweight Directory Access Protocol Version 3 703 Authorization is the use of this authentication information when 704 performing operations. Authorization MAY be affected by factors 705 outside of the LDAP Bind Request, such as those provided by lower 706 layer security services. 708 4.2.1. Processing of the Bind Request 710 Before processing a BindResponse, all outstanding operations MUST 711 either complete or be abandoned. The server may either wait for the 712 outstanding operations to complete, or abandon them. The server then 713 proceeds to authenticate the client in either a single-step, or 714 multi-step bind process. Each step requires the server to return a 715 BindResponse to indicate the status of authentication. 717 If the client did not bind before sending a request and receives an 718 operationsError to that request, it may then send a Bind Request. If 719 this also fails or the client chooses not to bind on the existing 720 connection, it may close the connection, reopen it and begin again by 721 first sending a PDU with a Bind Request. This will aid in 722 interoperating with servers implementing other versions of LDAP. 724 Clients may send multiple Bind Requests on a connection to change the 725 authentication and/or security associations or to complete a multi- 726 stage bind process. Authentication from earlier binds is subsequently 727 ignored. 729 For some SASL authentication mechanisms, it may be necessary for the 730 client to invoke the BindRequest multiple times. This is indicated by 731 the server sending a BindResponse with the resultCode set to 732 saslBindInProgress. This indicates that the server requires the 733 client to send a new bind request, with the same sasl mechanism, to 734 continue the authentication process. If at any stage the client 735 wishes to abort the bind process it MAY unbind and then drop the 736 underlying connection. Clients MUST NOT invoke operations between two 737 Bind Requests made as part of a multi-stage 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 leaving the connection in 750 an anonymous state. An abandoned Bind operation also has the effect 751 of leaving the connection in an anonymous state when (and if) the 752 server processes the abandonment of the bind. Client implementers 753 should note that the client has no way of being sure when (or if) an 754 abandon request succeeds, therefore, to arrive at a known 755 authentication state after abandoning a bind operation, clients may 756 Lightweight Directory Access Protocol Version 3 758 either unbind (which results in the underlying connection being 759 closed) or by issuing a bind request and then examining the 760 BindResponse returned by the server. 762 4.2.2. Bind Response 764 The Bind Response is defined as follows. 766 BindResponse ::= [APPLICATION 1] SEQUENCE { 767 COMPONENTS OF LDAPResult, 768 serverSaslCreds [7] OCTET STRING OPTIONAL } 770 BindResponse consists simply of an indication from the server of the 771 status of the client's request for authentication. 773 A successful bind operation is indicated by a BindResponse with a 774 resultCode set to success. Otherwise, an appropriate result code is 775 set in the BindResponse. For bind, the protocolError result code may 776 be used to indicate that the version number supplied by the client is 777 unsupported. 779 If the client receives a BindResponse response where the resultCode 780 field is protocolError, it MUST close the connection as the server 781 will be unwilling to accept further operations. (This is for 782 compatibility with earlier versions of LDAP, in which the bind was 783 always the first operation, and there was no negotiation.) 785 The serverSaslCreds are used as part of a SASL-defined bind mechanism 786 to allow the client to authenticate the server to which it is 787 communicating, or to perform "challenge-response" authentication. If 788 the client bound with the simple choice, or the SASL mechanism does 789 not require the server to return information to the client, then this 790 field SHALL NOT be included in the BindResponse. 792 4.3. Unbind Operation 794 The function of the Unbind Operation is to terminate an LDAP 795 association and connection. The Unbind operation is not the 796 antithesis of the Bind operation as the name implies. The naming of 797 these operations is historical. The Unbind operation should be 798 thought of as the "quit" operation. 800 The Unbind Operation is defined as follows: 802 UnbindRequest ::= [APPLICATION 2] NULL 804 The Unbind Operation has no response defined. Upon transmission of 805 the UnbindRequest, each protocol peer is to consider the LDAP 806 association terminated, MUST cease transmission of messages to the 807 other peer, and MUST close the connection. Any outstanding operations 808 on the server are, when possible, abandoned, and when not possible, 809 completed without transmission of the response. 811 Lightweight Directory Access Protocol Version 3 813 4.4. Unsolicited Notification 815 An unsolicited notification is an LDAPMessage sent from the server to 816 the client which is not in response to any LDAPMessage received by 817 the server. It is used to signal an extraordinary condition in the 818 server or in the connection between the client and the server. The 819 notification is of an advisory nature, and the server will not expect 820 any response to be returned from the client. 822 The unsolicited notification is structured as an LDAPMessage in which 823 the messageID is zero and protocolOp is of the extendedResp form. The 824 responseName field of the ExtendedResponse always contains an LDAPOID 825 which is unique for this notification. 827 One unsolicited notification (Notice of Disconnection) is defined in 828 this document. The specification of an unsolicited notification 829 consists of: 831 - the OBJECT IDENTIFIER assigned to the notification (to be 832 specified in the responseName, 834 - the format of the contents (if any) of the responseValue, 836 - the circumstances which will cause the notification to be 837 returned, and 839 - the semantics of the operation. 841 4.4.1. Notice of Disconnection 843 This notification may be used by the server to advise the client that 844 the server is about to close the connection due to an error 845 condition. Note that this notification is NOT a response to an unbind 846 requested by the client: the server MUST follow the procedures of 847 Section 4.3. This notification is intended to assist clients in 848 distinguishing between an error condition and a transient network 849 failure. As with a connection close due to network failure, the 850 client MUST NOT assume that any outstanding requests which modified 851 the Directory have succeeded or failed. 853 The responseName is 1.3.6.1.4.1.1466.20036, the response field is 854 absent, and the resultCode is used to indicate the reason for the 855 disconnection. 857 The following result codes have these meanings when used in this 858 notification: 860 - protocolError: The server has received data from the client in 861 which the LDAPMessage structure could not be parsed. 863 - strongAuthRequired: The server has detected that an established 864 security association between the client and server has 865 Lightweight Directory Access Protocol Version 3 867 unexpectedly failed or been compromised, or that the server now 868 requires the client to authenticate using a strong(er) mechanism. 870 - unavailable: This server will stop accepting new connections and 871 operations on all existing connections, and be unavailable for an 872 extended period of time. The client may make use of an alternative 873 server. 875 Upon transmission of the UnbindRequest, each protocol peer is to 876 consider the LDAP association terminated, MUST cease transmission of 877 messages to the other peer, and MUST close the connection. 879 4.5. Search Operation 881 The Search Operation is used to request a server to return, subject 882 to access controls and other restrictions, a set of entries matching 883 a complex search criterion. This can be used to read attributes from 884 a single entry, from entries immediately subordinate to a particular 885 entry, or a whole subtree of entries. 887 4.5.1. Search Request 889 The Search Request is defined as follows: 891 SearchRequest ::= [APPLICATION 3] SEQUENCE { 892 baseObject LDAPDN, 893 scope ENUMERATED { 894 baseObject (0), 895 singleLevel (1), 896 wholeSubtree (2) }, 897 derefAliases ENUMERATED { 898 neverDerefAliases (0), 899 derefInSearching (1), 900 derefFindingBaseObj (2), 901 derefAlways (3) }, 902 sizeLimit INTEGER (0 .. maxInt), 903 timeLimit INTEGER (0 .. maxInt), 904 typesOnly BOOLEAN, 905 filter Filter, 906 attributes AttributeSelection } 908 AttributeSelection ::= SEQUENCE OF selection LDAPString 909 -- constrained to below 911 Filter ::= CHOICE { 912 and [0] SET SIZE (1..MAX) OF filter Filter, 913 or [1] SET SIZE (1..MAX) OF filter Filter, 914 not [2] Filter, 915 equalityMatch [3] AttributeValueAssertion, 916 substrings [4] SubstringFilter, 917 greaterOrEqual [5] AttributeValueAssertion, 918 lessOrEqual [6] AttributeValueAssertion, 919 Lightweight Directory Access Protocol Version 3 921 present [7] AttributeDescription, 922 approxMatch [8] AttributeValueAssertion, 923 extensibleMatch [9] MatchingRuleAssertion } 925 SubstringFilter ::= SEQUENCE { 926 type AttributeDescription, 927 -- at least one must be present, 928 -- initial and final can occur at most once 929 substrings SEQUENCE SIZE (1..MAX) OF substring CHOICE { 930 initial [0] AssertionValue, 931 any [1] AssertionValue, 932 final [2] AssertionValue } } 934 MatchingRuleAssertion ::= SEQUENCE { 935 matchingRule [1] MatchingRuleId OPTIONAL, 936 type [2] AttributeDescription OPTIONAL, 937 matchValue [3] AssertionValue, 938 dnAttributes [4] BOOLEAN DEFAULT FALSE } 940 Parameters of the Search Request are: 942 - baseObject: The name of the base object entry relative to which 943 the search is to be performed. 945 - scope: Specifies the scope of the search to be performed. The 946 semantics (as described in [X.511]) of the possible values of this 947 field are: 949 baseObject: The scope is constrained to the entry named by 950 baseObject. 952 oneLevel: The scope is constrained to the immediate 953 subordinates of the entry named by baseObject. 955 wholeSubtree: the scope is constrained to the entry named 956 by the baseObject, and all its subordinates. 958 - derefAliases: An indicator as to how alias objects (as defined in 959 [X.501]) are to be handled in searching. The semantics of the 960 possible values of this field are: 962 neverDerefAliases: Do not dereference aliases in searching 963 or in locating the base object of the search. 965 derefInSearching: While searching, dereference any alias 966 object subordinate to the base object which is also in the 967 search scope. The filter is applied to the dereferenced 968 object(s). If the search scope is wholeSubtree, the search 969 continues in the subtree of any dereferenced object. 970 Aliases in that subtree are also dereferenced. Servers 971 SHOULD detect looping in this process to prevent denial of 972 service attacks and duplicate entries. 974 Lightweight Directory Access Protocol Version 3 976 derefFindingBaseObj: Dereference aliases in locating the 977 base object of the search, but not when searching 978 subordinates of the base object. 980 derefAlways: Dereference aliases both in searching and in 981 locating the base object of the search. 983 - sizeLimit: A size limit that restricts the maximum number of 984 entries to be returned as a result of the search. A value of zero 985 in this field indicates that no client-requested size limit 986 restrictions are in effect for the search. Servers may enforce a 987 maximum number of entries to return. 989 - timeLimit: A time limit that restricts the maximum time (in 990 seconds) allowed for a search. A value of zero in this field 991 indicates that no client-requested time limit restrictions are in 992 effect for the search. Servers may enforce a maximum time limit 993 for the search. 995 - typesOnly: An indicator as to whether search results are to 996 contain both attribute descriptions and values, or just attribute 997 descriptions. Setting this field to TRUE causes only attribute 998 descriptions (no values) to be returned. Setting this field to 999 FALSE causes both attribute descriptions and values to be 1000 returned. 1002 - filter: A filter that defines the conditions that must be 1003 fulfilled in order for the search to match a given entry. 1005 The 'and', 'or' and 'not' choices can be used to form combinations 1006 of filters. At least one filter element MUST be present in an 1007 'and' or 'or' choice. The others match against individual 1008 attribute values of entries in the scope of the search. 1009 (Implementor's note: the 'not' filter is an example of a tagged 1010 choice in an implicitly-tagged module. In BER this is treated as 1011 if the tag was explicit.) 1013 A server MUST evaluate filters according to the three-valued logic 1014 of X.511 (1993) Section 7.8.1. In summary, a filter is evaluated 1015 to either "TRUE", "FALSE" or "Undefined". If the filter evaluates 1016 to TRUE for a particular entry, then the attributes of that entry 1017 are returned as part of the search result (subject to any 1018 applicable access control restrictions). If the filter evaluates 1019 to FALSE or Undefined, then the entry is ignored for the search. 1021 A filter of the "and" choice is TRUE if all the filters in the SET 1022 OF evaluate to TRUE, FALSE if at least one filter is FALSE, and 1023 otherwise Undefined. A filter of the "or" choice is FALSE if all 1024 of the filters in the SET OF evaluate to FALSE, TRUE if at least 1025 one filter is TRUE, and Undefined otherwise. A filter of the "not" 1026 choice is TRUE if the filter being negated is FALSE, FALSE if it 1027 is TRUE, and Undefined if it is Undefined. 1029 The present match evaluates to TRUE where there is an attribute or 1030 Lightweight Directory Access Protocol Version 3 1032 subtype of the specified attribute description present in an 1033 entry, and FALSE otherwise (including a presence test with an 1034 unrecognized attribute description.) 1036 The matching rule for equalityMatch filter items is defined by the 1037 EQUALITY matching rule for the attribute type. 1039 The matching rule for AssertionValues in a substrings filter item 1040 is defined by the SUBSTR matching rule for the attribute type. 1041 Note that the AssertionValue in a substrings filter item MUST 1042 conform to the assertion syntax of the EQUALITY matching rule for 1043 the attribute type rather than the assertion syntax of the SUBSTR 1044 matching rule for the attribute type. The entire SubstringFilter 1045 is converted into an assertion value of the substrings matching 1046 rule prior to applying the rule. 1048 The matching rule for greaterOrEqual and lessOrEqual filter items 1049 is defined by the ORDERING matching rule for the attribute type. 1051 The approxMatch evaluates to TRUE when there is a value of the 1052 attribute or subtype for which some locally-defined approximate 1053 matching algorithm (e.g. spelling variations, phonetic match, 1054 etc.) returns TRUE. If an item matches for equality, it also 1055 satisfies an approximate match. If approximate matching is not 1056 supported, this filter item should be treated as an equalityMatch. 1058 An extensibleMatch is evaluated as follows: 1060 If the matchingRule field is absent, the type field MUST be 1061 present, and an equality match is performed for that type. 1063 If the type field is absent and the matchingRule is present, the 1064 matchValue is compared against all attributes in an entry which 1065 support that matchingRule. The matchingRule determines the 1066 syntax for the assertion value. The filter item evaluates to 1067 TRUE if it matches with at least one attribute in the entry, 1068 FALSE if it does not match any attribute in the entry, and 1069 Undefined if the matchingRule is not recognized or the 1070 assertionValue is invalid. 1072 If the type field is present and the matchingRule is present, 1073 the matchValue is compared against entry attributes of the 1074 specified type. In this case, the matchingRule MUST be one 1075 suitable for use with the specified type (see [Syntaxes]), 1076 otherwise the filter item is undefined. 1078 If the dnAttributes field is set to TRUE, the match is 1079 additionally applied against all the AttributeValueAssertions in 1080 an entry's distinguished name, and evaluates to TRUE if there is 1081 at least one attribute in the distinguished name for which the 1082 filter item evaluates to TRUE. The dnAttributes field is present 1083 to alleviate the need for multiple versions of generic matching 1084 rules (such as word matching), where one applies to entries and 1085 Lightweight Directory Access Protocol Version 3 1087 another applies to entries and dn attributes as well. 1089 A filter item evaluates to Undefined when the server would not be 1090 able to determine whether the assertion value matches an entry. If 1091 an attribute description in an equalityMatch, substrings, 1092 greaterOrEqual, lessOrEqual, approxMatch or extensibleMatch filter 1093 is not recognized by the server, a matching rule id in the 1094 extensibleMatch is not recognized by the server, the assertion 1095 value is invalid, or the type of filtering requested is not 1096 implemented, then the filter is Undefined. Thus for example if a 1097 server did not recognize the attribute type shoeSize, a filter of 1098 (shoeSize=*) would evaluate to FALSE, and the filters 1099 (shoeSize=12), (shoeSize>=12) and (shoeSize<=12) would evaluate to 1100 Undefined. 1102 Servers MUST NOT return errors if attribute descriptions or 1103 matching rule ids are not recognized, assertion values are 1104 invalid, or the assertion syntax is not supported. More details of 1105 filter processing are given in Section 7.8 of [X.511]. 1107 - attributes: A list of the attributes to be returned from each 1108 entry which matches the search filter. LDAPString values of this 1109 field are constrained to the following Augmented Backus-Naur Form 1110 [(ABNF)]: 1112 attributeSelection = noattrs / 1113 *( attributedescription / specialattr ) 1115 noattrs = %x31 %x2E %x31 ; "1.1" 1117 specialattr = ASTERISK 1119 ASTERISK = %x2A ; asterisk ("*") 1121 is defined in Section 2.5 of [Models]. 1123 There are two special values which may be used: an empty list with 1124 no attributes, and the attribute description string "*". Both of 1125 these signify that all user attributes are to be returned. (The 1126 "*" allows the client to request all user attributes in addition 1127 to any specified operational attributes). Client implementors 1128 should note that even if all user attributes are requested, some 1129 attributes and or attribute values of the entry may not be 1130 included in search results due to access controls or other 1131 restrictions. Furthermore, servers will not return operational 1132 attributes, such as objectClasses or attributeTypes, unless they 1133 are listed by name. Operational attributes are described in 1134 [Models]. 1136 Attributes MUST NOT be named more than once in the list, and are 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 Lightweight Directory Access Protocol Version 3 1143 If the client does not want any attributes returned, it can 1144 specify a list containing only the attribute with OID "1.1". This 1145 OID was chosen because it does not (and can not) correspond to any 1146 attribute in use. 1148 Note that an X.500 "list"-like operation can be emulated by the 1149 client requesting a one-level LDAP search operation with a filter 1150 checking for the presence of the objectClass attribute, and that an 1151 X.500 "read"-like operation can be emulated by a base object LDAP 1152 search operation with the same filter. A server which provides a 1153 gateway to X.500 is not required to use the Read or List operations, 1154 although it may choose to do so, and if it does, it must provide the 1155 same semantics as the X.500 search operation. 1157 4.5.2. Search Result 1159 The results of the search operation are returned as zero or more 1160 searchResultEntry messages, zero or more SearchResultReference 1161 messages, followed by a single searchResultDone message. 1163 SearchResultEntry ::= [APPLICATION 4] SEQUENCE { 1164 objectName LDAPDN, 1165 attributes PartialAttributeList } 1167 PartialAttributeList ::= SEQUENCE OF 1168 partialAttribute PartialAttribute 1169 -- Note that the PartialAttributeList may hold zero elements. 1170 -- This may happen when none of the attributes of an entry 1171 -- were requested, or could be returned. 1172 -- Note also that the partialAttribute vals set may hold zero 1173 -- elements. This may happen when typesOnly is requested, access 1174 -- controls prevent the return of values, or other reasons. 1176 SearchResultReference ::= [APPLICATION 19] SEQUENCE 1177 SIZE (1..MAX) OF uri URI 1179 SearchResultDone ::= [APPLICATION 5] LDAPResult 1181 Each SearchResultEntry represents an entry found during the search. 1182 Each SearchResultReference represents an area not yet explored during 1183 the search. The SearchResultEntry and SearchResultReference PDUs may 1184 come in any order. Following all the SearchResultReference and 1185 SearchResultEntry responses, the server returns a SearchResultDone 1186 response, which contains an indication of success, or detailing any 1187 errors that have occurred. 1189 Each entry returned in a SearchResultEntry will contain all 1190 appropriate attributes as specified in the attributes field of the 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 Lightweight Directory Access Protocol Version 3 1198 attributes of an entry. Clients SHOULD NOT assume that all attributes 1199 can be modified, even if permitted by access control. 1201 If the server's schema defines short names [Models] for an attribute 1202 type then the server SHOULD use one of those names in attribute 1203 descriptions for that attribute type (in preference to using the 1204 [Models] format of the attribute type's object 1205 identifier). The server SHOULD NOT use the short name if that name is 1206 known by the server to be ambiguous, or otherwise likely to cause 1207 interoperability problems. 1209 4.5.3. Continuation References in the Search Result 1211 If the server was able to locate the entry referred to by the 1212 baseObject but was unable to search all the entries in the scope at 1213 and subordinate to the baseObject, the server may return one or more 1214 SearchResultReference entries, each containing a reference to another 1215 set of servers for continuing the operation. A server MUST NOT return 1216 any SearchResultReference if it has not located the baseObject and 1217 thus has not searched any entries; in this case it would return a 1218 SearchResultDone containing a referral result code. 1220 If a server holds a copy or partial copy of the subordinate naming 1221 context, it may use the search filter to determine whether or not to 1222 return a SearchResultReference response. Otherwise 1223 SearchResultReference responses are always returned when in scope. 1225 The SearchResultReference is of the same data type as the Referral. 1227 A URI for a server implementing LDAP and accessible via [TCP]/[IP] 1228 (v4 or v6) is written as an LDAP URL according to [LDAPURL]. 1230 In order to complete the search, the client issues a new search 1231 operation for each SearchResultReference that is returned. Note that 1232 the abandon operation described in Section 4.11 applies only to a 1233 particular operation sent on an association between a client and 1234 server. The client must abandon subsequent search operations it 1235 wishes to individually. 1237 Clients that follow search continuation references MUST ensure that 1238 they do not loop between servers. They MUST NOT repeatedly contact 1239 the same server for the same request with the same target entry name, 1240 scope and filter. Some clients use a counter that is incremented each 1241 time search result reference handling occurs for an operation, and 1242 these kinds of clients MUST be able to handle at least ten nested 1243 search result references between the root and a leaf entry. 1245 When an LDAP URL is used, the following instructions are followed: 1246 - The part of the URL MUST be present, with the new target 1247 object name. The client MUST use this name when following the 1248 referral. Note that UTF-8 characters appearing in a DN or search 1249 filter may not be legal for URLs (e.g. spaces) and MUST be 1250 escaped using the % method in [URI]. 1252 Lightweight Directory Access Protocol Version 3 1254 - It is RECOMMENDED that the part be present to avoid 1255 ambiguity. 1256 - Some servers (e.g. participating in distributed indexing) may 1257 provide a different filter in a URL of a SearchResultReference. 1258 - If the part of the URL is present, the client MUST use 1259 this filter in its next request to progress this search, and if 1260 it is not present the client MUST use the same filter as it used 1261 for that search. 1262 - If the originating search scope was singleLevel, the 1263 part of the URL will be "base". 1264 - it is RECOMMENDED that the part be present to avoid 1265 ambiguity. 1266 - If the part is missing, the scope of the original search 1267 is used by the client to progress the operation. 1268 - Other aspects of the new search request may be the same as or 1269 different from the search request which generated the 1270 SearchResultReference. 1271 - The name of an unexplored subtree in a SearchResultReference 1272 need not be subordinate to the base object. 1274 Other kinds of URIs may be returned. The syntax and semantics of such 1275 URIs is left to future specifications. Clients ignore URIs that they 1276 do not support. 1278 4.5.3.1. Example 1280 For example, suppose the contacted server (hosta) holds the entry 1281 "DC=Example,DC=NET" and the entry "CN=Manager,DC=Example,DC=NET". It 1282 knows that either LDAP-capable servers (hostb) or (hostc) hold 1283 "OU=People,DC=Example,DC=NET" (one is the master and the other server 1284 a shadow), and that LDAP-capable server (hostd) holds the subtree 1285 "OU=Roles,DC=Example,DC=NET". If a subtree search of 1286 "DC=Example,DC=NET" is requested to the contacted server, it may 1287 return the following: 1289 SearchResultEntry for DC=Example,DC=NET 1290 SearchResultEntry for CN=Manager,DC=Example,DC=NET 1291 SearchResultReference { 1292 ldap://hostb/OU=People,DC=Example,DC=NET??sub 1293 ldap://hostc/OU=People,DC=Example,DC=NET??sub } 1294 SearchResultReference { 1295 ldap://hostd/OU=Roles,DC=Example,DC=NET??sub } 1296 SearchResultDone (success) 1298 Client implementors should note that when following a 1299 SearchResultReference, additional SearchResultReference may be 1300 generated. Continuing the example, if the client contacted the server 1301 (hostb) and issued the search for the subtree 1302 "OU=People,DC=Example,DC=NET", the server might respond as follows: 1304 SearchResultEntry for OU=People,DC=Example,DC=NET 1305 SearchResultReference { 1306 ldap://hoste/OU=Managers,OU=People,DC=Example,DC=NET??sub } 1307 Lightweight Directory Access Protocol Version 3 1309 SearchResultReference { 1310 ldap://hostf/OU=Consultants,OU=People,DC=Example,DC=NET??sub } 1311 SearchResultDone (success) 1313 If the contacted server does not hold the base object for the search, 1314 then it will return a referral to the client. For example, if the 1315 client requests a subtree search of "DC=Example,DC=ORG" to hosta, the 1316 server may return only a SearchResultDone containing a referral. 1318 SearchResultDone (referral) { 1319 ldap://hostg/DC=Example,DC=ORG??sub } 1321 4.6. Modify Operation 1323 The Modify Operation allows a client to request that a modification 1324 of an entry be performed on its behalf by a server. The Modify 1325 Request is defined as follows: 1327 ModifyRequest ::= [APPLICATION 6] SEQUENCE { 1328 object LDAPDN, 1329 changes SEQUENCE OF change SEQUENCE { 1330 operation ENUMERATED { 1331 add (0), 1332 delete (1), 1333 replace (2) }, 1334 modification PartialAttribute } } 1336 Parameters of the Modify Request are: 1338 - object: The name of the object to be modified. The value of this 1339 field contains the DN of the entry to be modified. The server 1340 SHALL NOT perform any alias dereferencing in determining the 1341 object to be modified. 1343 - changes: A list of modifications to be performed on the entry. The 1344 entire list of modifications MUST be performed in the order they 1345 are listed, as a single atomic operation. While individual 1346 modifications may violate certain aspects of the directory schema 1347 (such as the object class definition and DIT content rule), the 1348 resulting entry after the entire list of modifications is 1349 performed MUST conform to the requirements of the directory 1350 schema. 1352 - operation: Used to specify the type of modification being 1353 performed. Each operation type acts on the following 1354 modification. The values of this field have the following 1355 semantics respectively: 1357 add: add values listed to the modification attribute, 1358 creating the attribute if necessary; 1360 delete: delete values listed from the modification 1361 attribute, removing the entire attribute if no values are 1362 Lightweight Directory Access Protocol Version 3 1364 listed, or if all current values of the attribute are 1365 listed for deletion; 1367 replace: replace all existing values of the modification 1368 attribute with the new values listed, creating the 1369 attribute if it did not already exist. A replace with no 1370 value will delete the entire attribute if it exists, and is 1371 ignored if the attribute does not exist. 1373 - modification: A PartialAttribute (which may have an empty SET of 1374 vals) used to hold the attribute type or attribute type and 1375 values being modified. 1377 Upon receipt of a Modify Request, the server attempts to perform the 1378 necessary modifications to the DIT and returns the result in a Modify 1379 Response, defined as follows: 1381 ModifyResponse ::= [APPLICATION 7] LDAPResult 1383 The server will return to the client a single Modify Response 1384 indicating either the successful completion of the DIT modification, 1385 or the reason that the modification failed. Note that due to the 1386 requirement for atomicity in applying the list of modifications in 1387 the Modify Request, the client may expect that no modifications of 1388 the DIT have been performed if the Modify Response received indicates 1389 any sort of error, and that all requested modifications have been 1390 performed if the Modify Response indicates successful completion of 1391 the Modify Operation. If the association changes or the connection 1392 fails, whether the modification occurred or not is indeterminate. 1394 The Modify Operation cannot be used to remove from an entry any of 1395 its distinguished values, i.e. those values which form the entry's 1396 relative distinguished name. An attempt to do so will result in the 1397 server returning the notAllowedOnRDN result code. The Modify DN 1398 Operation described in Section 4.9 is used to rename an entry. 1400 Note that due to the simplifications made in LDAP, there is not a 1401 direct mapping of the changes in an LDAP ModifyRequest onto the 1402 changes of a DAP ModifyEntry operation, and different implementations 1403 of LDAP-DAP gateways may use different means of representing the 1404 change. If successful, the final effect of the operations on the 1405 entry MUST be identical. 1407 4.7. Add Operation 1409 The Add Operation allows a client to request the addition of an entry 1410 into the Directory. The Add Request is defined as follows: 1412 AddRequest ::= [APPLICATION 8] SEQUENCE { 1413 entry LDAPDN, 1414 attributes AttributeList } 1416 AttributeList ::= SEQUENCE OF attribute Attribute 1417 Lightweight Directory Access Protocol Version 3 1419 Parameters of the Add Request are: 1421 - entry: the name of the entry to be added. Note that the server 1422 SHALL NOT dereference any aliases in locating the entry to be 1423 added. 1425 - attributes: the list of attributes that make up the content of the 1426 entry being added. Clients MUST include distinguished values 1427 (those forming the entry's own RDN) in this list, the objectClass 1428 attribute, and values of any mandatory attributes of the listed 1429 object classes. Clients MUST NOT supply NO-USER-MODIFICATION 1430 attributes such as the createTimestamp or creatorsName attributes, 1431 since the server maintains these automatically. 1433 The entry named in the entry field of the AddRequest MUST NOT exist 1434 for the AddRequest to succeed. The immediate superior (parent) of an 1435 object or alias entry to be added MUST exist. For example, if the 1436 client attempted to add "CN=JS,DC=Example,DC=NET", the 1437 "DC=Example,DC=NET" entry did not exist, and the "DC=NET" entry did 1438 exist, then the server would return the noSuchObject result code with 1439 the matchedDN field containing "DC=NET". If the parent entry exists 1440 but is not in a naming context held by the server, the server SHOULD 1441 return a referral to the server holding the parent entry. 1443 Server implementations SHOULD NOT restrict where entries can be 1444 located in the Directory unless DIT structure rules are in place. 1445 Some servers allow the administrator to restrict the classes of 1446 entries which can be added to the Directory. 1448 Upon receipt of an Add Request, a server will attempt to add the 1449 requested entry. The result of the add attempt will be returned to 1450 the client in the Add Response, defined as follows: 1452 AddResponse ::= [APPLICATION 9] LDAPResult 1454 A response of success indicates that the new entry is present in the 1455 Directory. 1457 4.8. Delete Operation 1459 The Delete Operation allows a client to request the removal of an 1460 entry from the Directory. The Delete Request is defined as follows: 1462 DelRequest ::= [APPLICATION 10] LDAPDN 1464 The Delete Request consists of the name of the entry to be deleted. 1465 The server SHALL NOT dereference aliases while resolving the name of 1466 the target entry to be removed. 1468 Only leaf entries (those with no subordinate entries) can be deleted 1469 with this operation. 1471 Lightweight Directory Access Protocol Version 3 1473 Upon receipt of a Delete Request, a server will attempt to perform 1474 the entry removal requested and return the result in the Delete 1475 Response defined as follows: 1477 DelResponse ::= [APPLICATION 11] LDAPResult 1479 4.9. Modify DN Operation 1481 The Modify DN Operation allows a client to change the Relative 1482 Distinguished Name (RDN) of an entry in the Directory, and/or to move 1483 a subtree of entries to a new location in the Directory. The Modify 1484 DN Request is defined as follows: 1486 ModifyDNRequest ::= [APPLICATION 12] SEQUENCE { 1487 entry LDAPDN, 1488 newrdn RelativeLDAPDN, 1489 deleteoldrdn BOOLEAN, 1490 newSuperior [0] LDAPDN OPTIONAL } 1492 Parameters of the Modify DN Request are: 1494 - entry: the name of the entry to be changed. This entry may or may 1495 not have subordinate entries. Note that the server SHALL NOT 1496 dereference any aliases in locating the entry to be changed. 1498 - newrdn: the new RDN of the entry. 1500 - deleteoldrdn: a boolean parameter that controls whether the old 1501 RDN attribute values are to be retained as attributes of the 1502 entry, or deleted from the entry. 1504 - newSuperior: if present, this is the name of an existing object 1505 entry which becomes the immediate superior (parent) of the 1506 existing entry. 1508 Upon receipt of a ModifyDNRequest, a server will attempt to perform 1509 the name change and return the result in the Modify DN Response, 1510 defined as follows: 1512 ModifyDNResponse ::= [APPLICATION 13] LDAPResult 1514 For example, if the entry named in the "entry" parameter was "cn=John 1515 Smith,c=US", the newrdn parameter was "cn=John Cougar Smith", and the 1516 newSuperior parameter was absent, then this operation would attempt 1517 to rename the entry to be "cn=John Cougar Smith,c=US". If there was 1518 already an entry with that name, the operation would fail with the 1519 entryAlreadyExists result code. 1521 The object named in newSuperior MUST exist. For example, if the 1522 client attempted to add "CN=JS,DC=Example,DC=NET", the 1523 "DC=Example,DC=NET" entry did not exist, and the "DC=NET" entry did 1524 exist, then the server would return the noSuchObject result code with 1525 the matchedDN field containing "DC=NET". 1527 Lightweight Directory Access Protocol Version 3 1529 If the deleteoldrdn parameter is TRUE, the values forming the old RDN 1530 are deleted from the entry. If the deleteoldrdn parameter is FALSE, 1531 the values forming the old RDN will be retained as non-distinguished 1532 attribute values of the entry. The server MUST fail the operation and 1533 return an error in the result code if the setting of the deleteoldrdn 1534 parameter would cause a schema inconsistency in the entry. 1536 Note that X.500 restricts the ModifyDN operation to only affect 1537 entries that are contained within a single server. If the LDAP server 1538 is mapped onto DAP, then this restriction will apply, and the 1539 affectsMultipleDSAs result code will be returned if this error 1540 occurred. In general, clients MUST NOT expect to be able to perform 1541 arbitrary movements of entries and subtrees between servers or 1542 between naming contexts. 1544 4.10. Compare Operation 1546 The Compare Operation allows a client to compare an assertion 1547 provided with an entry in the Directory. The Compare Request is 1548 defined as follows: 1550 CompareRequest ::= [APPLICATION 14] SEQUENCE { 1551 entry LDAPDN, 1552 ava AttributeValueAssertion } 1554 Parameters of the Compare Request are: 1556 - entry: the name of the entry to be compared. Note that the server 1557 SHALL NOT dereference any aliases in locating the entry to be 1558 compared. 1560 - ava: the assertion with which an attribute in the entry is to be 1561 compared. 1563 Upon receipt of a Compare Request, a server will attempt to perform 1564 the requested comparison using the EQUALITY matching rule for the 1565 attribute type and return the result in the Compare Response, defined 1566 as follows: 1568 CompareResponse ::= [APPLICATION 15] LDAPResult 1570 In the event that the attribute or subtype is not present in the 1571 entry, the resultCode field is set to noSuchAttribute. If the 1572 attribute is unknown, the resultCode is set to 1573 undefinedAttributeType. Note that errors and the result of comparison 1574 are all returned in the same construct. 1576 Note that some directory systems may establish access controls which 1577 permit the values of certain attributes (such as userPassword) to be 1578 compared but not interrogated by other means. 1580 Lightweight Directory Access Protocol Version 3 1582 4.11. Abandon Operation 1584 The function of the Abandon Operation is to allow a client to request 1585 that the server abandon an outstanding operation. The Abandon Request 1586 is defined as follows: 1588 AbandonRequest ::= [APPLICATION 16] MessageID 1590 The MessageID MUST be that of an operation which was requested 1591 earlier in this LDAP association. The abandon request itself has its 1592 own message id. This is distinct from the id of the earlier operation 1593 being abandoned. 1595 There is no response defined in the Abandon operation. Upon receipt 1596 of an AbandonRequest, the server MAY abandon the operation identified 1597 by the MessageID. Operation responses are not sent for successfully 1598 abandoned operations, thus the application of the Abandon operation 1599 is limited to uses where the client does not require an indication of 1600 its outcome. 1602 Abandon and Unbind operations cannot be abandoned. The ability to 1603 abandon other (particularly update) operations is at the discretion 1604 of the server. 1606 In the event that a server receives an Abandon Request on a Search 1607 Operation in the midst of transmitting responses to the search, that 1608 server MUST cease transmitting entry responses to the abandoned 1609 request immediately, and MUST NOT send the SearchResponseDone. Of 1610 course, the server MUST ensure that only properly encoded LDAPMessage 1611 PDUs are transmitted. 1613 Clients MUST NOT send abandon requests for the same operation 1614 multiple times, and MUST also be prepared to receive results from 1615 operations it has abandoned (since these may have been in transit 1616 when the abandon was requested, or are not able to be abandoned). 1618 Servers MUST discard abandon requests for message IDs they do not 1619 recognize, for operations which cannot be abandoned, and for 1620 operations which have already been abandoned. 1622 4.12. Extended Operation 1624 The extended operation allows additional operations to be defined for 1625 services not already available in the protocol. For example, to add 1626 operations to install transport layer security (see Section 4.13). 1628 The extended operation allows clients to make requests and receive 1629 responses with predefined syntaxes and semantics. These may be 1630 defined in RFCs or be private to particular implementations. 1632 Each extended operation consists of an extended request and an 1633 extended response. 1635 Lightweight Directory Access Protocol Version 3 1637 ExtendedRequest ::= [APPLICATION 23] SEQUENCE { 1638 requestName [0] LDAPOID, 1639 requestValue [1] OCTET STRING OPTIONAL } 1641 The requestName is a dotted-decimal representation of the unique 1642 OBJECT IDENTIFIER corresponding to the request. The requestValue is 1643 information in a form defined by that request, encapsulated inside an 1644 OCTET STRING. 1646 The server will respond to this with an LDAPMessage containing the 1647 ExtendedResponse. 1649 ExtendedResponse ::= [APPLICATION 24] SEQUENCE { 1650 COMPONENTS OF LDAPResult, 1651 responseName [10] LDAPOID OPTIONAL, 1652 responseValue [11] OCTET STRING OPTIONAL } 1654 The responseName is typically not required to be present as the 1655 syntax and semantics of the response (including the format of the 1656 responseValue) is implicitly known and associated with the request by 1657 the messageID. 1659 If the requestName is not recognized by the server, the server MUST 1660 NOT provide a responseName nor a responseValue and MUST return a 1661 resultCode of protocolError. 1663 The requestValue and responseValue fields contain any information 1664 associated with the operation. The format of these fields is defined 1665 by the specification of the extended operation. Implementations MUST 1666 be prepared to handle arbitrary contents of these fields, including 1667 zero bytes. Values that are defined in terms of ASN.1 and BER encoded 1668 according to Section 5.1, also follow the extensibility rules in 1669 Section 4. 1671 It is RECOMMENDED that servers list the requestName of extended 1672 operations they support in the supportedExtension attribute [Models] 1673 of the root DSE. 1675 Extended operations may be specified in other documents. The 1676 specification of an extended operation consists of: 1678 - the OBJECT IDENTIFIER assigned to the requestName (and possibly 1679 responseName), 1681 - the format of the contents of the requestValue and responseValue 1682 (if any), 1684 - the semantics of the operation, 1686 4.13. StartTLS Operation 1687 Lightweight Directory Access Protocol Version 3 1689 The Start Transport Layer Security (StartTLS) operation provides the 1690 ability to establish Transport Layer Security ([TLS]) on an LDAP 1691 connection. The StartTLS operation is defined using the extended 1692 operation mechanism described in Section 4.12. 1694 4.13.1. StartTLS Request 1696 A client requests TLS establishment by transmitting a StartTLS 1697 request PDU to the server. The StartTLS request is defined in terms 1698 of an ExtendedRequest. The requestName is "1.3.6.1.4.1.1466.20037", 1699 and the requestValue field is always absent. 1701 The client MUST NOT send any PDUs on this connection following this 1702 request until it receives a StartTLS extended response. 1704 4.13.2. StartTLS Response 1706 When a StartTLS request is made, servers supporting the operation 1707 MUST return a StartTLS response PDU to the requestor. The StartTLS 1708 response responseName is also "1.3.6.1.4.1.1466.20037", and the 1709 response field is absent. 1711 The server MUST set the resultCode field to either success or one of 1712 the other values outlined in Section 4.13.2.2. 1714 4.13.2.1. "Success" Response 1716 If the StartTLS Response contains a result code of success, this 1717 indicates that the server is willing and able to negotiate TLS. Refer 1718 to Section 5.3 of [AuthMeth] for details. 1720 4.13.2.2. Response other than "success" 1722 If the ExtendedResponse contains a result code other than success, 1723 this indicates that the server is unwilling or unable to negotiate 1724 TLS. The following result codes have these meanings for this 1725 operation: 1727 - operationsError: operations sequencing incorrect; e.g. TLS is 1728 already established. 1730 - protocolError: TLS is not supported or incorrect PDU structure. 1732 - unavailable: Some major problem with TLS, or the server is 1733 shutting down. 1735 The server MUST return operationsError if the client violates any of 1736 the StartTLS extended operation sequencing requirements described in 1737 Section 5.3 of [AuthMeth]. 1739 If the server does not support TLS (whether by design or by current 1740 configuration), it MUST set the resultCode field to protocolError. 1741 The client's current association is unaffected if the server does not 1742 Lightweight Directory Access Protocol Version 3 1744 support TLS. The client may proceed with any LDAP operation, or it 1745 may close the connection. 1747 The server MUST return unavailable if it supports TLS but cannot 1748 establish a TLS connection for some reason, e.g. the certificate 1749 server not responding, it cannot contact its TLS implementation, or 1750 if the server is in process of shutting down. The client may retry 1751 the StartTLS operation, or it may proceed with any other LDAP 1752 operation, or it may close the LDAP connection. 1754 4.13.3. Closing a TLS Connection 1756 Two forms of TLS connection closure -- graceful and abrupt -- are 1757 supported. 1759 4.13.3.1. Graceful Closure 1761 Either the client or server MAY terminate the TLS connection and 1762 leave the LDAP connection intact by sending and receiving a TLS 1763 closure alert. 1765 The initiating protocol peer sends the TLS closure alert. If it 1766 wishes to leave the LDAP connection intact, it then MUST cease to 1767 send further PDUs and MUST ignore any received PDUs until it receives 1768 a TLS closure alert from the other peer. 1770 Once the initiating protocol peer receives a TLS closure alert from 1771 the other peer it MAY send and receive LDAP PDUs. 1773 When a protocol peer receives the initial TLS closure alert, it may 1774 choose to allow the underlying LDAP connection intact. In this case, 1775 it MUST immediately transmit a TLS closure alert. Following this, it 1776 MAY send and receive LDAP PDUs. 1778 Protocol peers MAY drop the underlying LDAP connection after sending 1779 or receiving a TLS closure alert. 1781 After the TLS connection has been closed, the server MUST NOT send 1782 responses to any request message received before the TLS closure. 1783 Thus, clients wishing to receive responses to messages sent while the 1784 TLS connection is intact MUST wait for those message responses before 1785 sending the TLS closure alert. 1787 4.13.3.2. Abrupt Closure 1789 Either the client or server MAY abruptly close the TLS connection by 1790 dropping the underlying transfer protocol connection. In this 1791 circumstance, a server MAY send the client a Notice of Disconnection 1792 before dropping the underlying LDAP connection. 1794 5. Protocol Element Encodings and Transfer 1795 Lightweight Directory Access Protocol Version 3 1797 One underlying service, LDAP over TCP, is defined here. This service 1798 is generally applicable to applications providing or consuming X.500- 1799 based directory services on the Internet. 1801 Implementations of LDAP over TCP MUST implement the mapping as 1802 described in Section 5.2.1 1804 5.1. Protocol Encoding 1806 The protocol elements of LDAP SHALL be encoded for exchange using the 1807 Basic Encoding Rules [BER] of [ASN.1] with the following 1808 restrictions: 1810 (1) Only the definite form of length encoding is used. 1812 (2) OCTET STRING values are encoded in the primitive form only. 1814 (3) If the value of a BOOLEAN type is true, the encoding of the 1815 value octet is set to hex "FF". 1817 (4) If a value of a type is its default value, it is absent. Only 1818 some BOOLEAN and INTEGER types have default values in this 1819 protocol definition. 1821 These restrictions are meant to ease the overhead of encoding and 1822 decoding certain elements in BER. 1824 These restrictions do not apply to ASN.1 types encapsulated inside of 1825 OCTET STRING values, such as attribute values, unless otherwise 1826 stated. 1828 5.2. Transfer Protocols 1830 This protocol is designed to run over connection-oriented, reliable 1831 transports, with all 8 bits in an octet being significant in the data 1832 stream. 1834 5.2.1. Transmission Control Protocol (TCP) 1836 The encoded LDAPMessage PDUs are mapped directly onto the [TCP] 1837 bytestream using the BER-based encoding described in Section 5.1. It 1838 is recommended that server implementations running over the TCP 1839 provide a protocol listener on the assigned port, 389. Servers may 1840 instead provide a listener on a different port number. Clients MUST 1841 support contacting servers on any valid TCP port. 1843 6. Security Considerations 1845 This version of the protocol provides facilities for simple 1846 authentication using a cleartext password, as well as any [SASL] 1847 Lightweight Directory Access Protocol Version 3 1849 mechanism. SASL allows for integrity and privacy services to be 1850 negotiated. 1852 It is also permitted that the server can return its credentials to 1853 the client, if it chooses to do so. 1855 Use of cleartext password is strongly discouraged where the 1856 underlying transport service cannot guarantee confidentiality and may 1857 result in disclosure of the password to unauthorized parties. 1859 Servers are encouraged to prevent directory modifications by clients 1860 that have authenticated anonymously [AuthMeth]. 1862 Requirements of authentication methods, SASL mechanisms, and TLS are 1863 described in [AuthMeth]. 1865 It should be noted that SASL authentication exchanges do not provide 1866 data confidentiality nor integrity protection for the version or name 1867 fields of the bind request nor the resultCode, diagnosticMessage, or 1868 referral fields of the bind response nor of any information contained 1869 in controls attached to bind request or responses. Thus information 1870 contained in these fields SHOULD NOT be relied on unless otherwise 1871 protected (such as by establishing protections at the transport 1872 layer). 1874 Server implementors should plan for the possibility of an identity 1875 associated with an LDAP connection being deleted, renamed, or 1876 modified, and take appropriate actions to prevent insecure side 1877 effects. Likewise, server implementors should plan for the 1878 possibility of an associated identity's credentials becoming invalid, 1879 or an identities privileges being changed. The way in which these 1880 issues are addressed are application 1881 and/or implementation specific. 1883 Implementations which cache attributes and entries obtained via LDAP 1884 MUST ensure that access controls are maintained if that information 1885 is to be provided to multiple clients, since servers may have access 1886 control policies which prevent the return of entries or attributes in 1887 search results except to particular authenticated clients. For 1888 example, caches could serve result information only to the client 1889 whose request caused it to be in the cache. 1891 Protocol servers may return referrals which redirect protocol clients 1892 to peer servers. It is possible for a rogue application to inject 1893 such referrals into the data stream in an attempt to redirect a 1894 client to a rogue server. Protocol clients are advised to be aware of 1895 this, and possibly reject referrals when confidentiality measures are 1896 not in place. Protocol clients are advised to reject referrals from 1897 the StartTLS operation. 1899 Protocol peers MUST be prepared to handle invalid and arbitrary 1900 length protocol encodings. A number of LDAP security advisories are 1901 available through [CERT]. 1903 Lightweight Directory Access Protocol Version 3 1905 7. Acknowledgements 1907 This document updates RFC 2251 by Mark Wahl, Tim Howes, and Steve 1908 Kille. It also updates RFC 2830 by Jeff Hodges, RL "Bob" Morgan, and 1909 Mark Wahl. Their work along with the input of individuals of the IETF 1910 ASID, LDAPEXT, LDUP, LDAPBIS, and other Working Groups is gratefully 1911 acknowledged. 1913 8. Normative References 1915 [ABNF] Crocker, D. and P. Overell, "Augmented BNF for Syntax 1916 Specifications: ABNF", RFC 2234, November 1997. 1918 [ASN.1] ITU-T Recommendation X.680 (07/2002) | ISO/IEC 8824-1:2002 1919 "Information Technology - Abstract Syntax Notation One 1920 (ASN.1): Specification of basic notation" 1922 [AuthMeth] Harrison, R., "LDAP: Authentication Methods and Connection 1923 Level Security Mechanisms ", draft-ietf-ldapbis-authmeth- 1924 xx.txt, (a work in progress). 1926 [BER] ITU-T Rec. X.690 (07/2002) | ISO/IEC 8825-1:2002, 1927 "Information technology - ASN.1 encoding rules: 1928 Specification of Basic Encoding Rules (BER), Canonical 1929 Encoding Rules (CER) and Distinguished Encoding Rules 1930 (DER)", 2002. 1932 [IP] Postel, J., "Internet Protocol", STD5 and RFC 791, 1933 September 1981 1935 [ISO10646] Universal Multiple-Octet Coded Character Set (UCS) - 1936 Architecture and Basic Multilingual Plane, ISO/IEC 10646-1 1937 : 1993. 1939 [Keyword] Bradner, S., "Key words for use in RFCs to Indicate 1940 Requirement Levels", RFC 2119, March 1997. 1942 [LDAPDN] Zeilenga, K., "LDAP: String Representation of 1943 Distinguished Names", draft-ietf-ldapbis-dn-xx.txt, (a 1944 work in progress). 1946 [LDAPIANA] Zeilenga, K., "IANA Considerations for LDAP", draft-ietf- 1947 ldapbis-bcp64-xx.txt, (a work in progress). 1949 [LDAPURL] Smith, M., "LDAP: Uniform Resource Locator", draft-ietf- 1950 ldapbis-url-xx.txt, (a work in progress). 1952 [Models] Zeilenga, K., "LDAP: Directory Information Models", draft- 1953 ietf-ldapbis-models-xx.txt (a work in progress). 1955 [Roadmap] Zeilenga, K., "LDAP: Technical Specification Road Map", 1956 draft-ietf-ldapbis-roadmap-xx.txt (a work in progress). 1958 Lightweight Directory Access Protocol Version 3 1960 [SASL] Melnikov, A., "Simple Authentication and Security Layer", 1961 draft-ietf-sasl-rfc2222bis-xx.txt (a work in progress). 1963 [SASLPrep] Zeilenga, K., "Stringprep profile for user names and 1964 passwords", draft-ietf-sasl-saslprep-xx.txt, (a work in 1965 progress). 1967 [StringPrep] Hoffman P. and M. Blanchet, "Preparation of 1968 Internationalized Strings ('stringprep')", draft-hoffman- 1969 rfc3454bis-xx.txt, a work in progress. 1971 [Syntaxes] Legg, S., and K. Dally, "LDAP: Syntaxes and Matching 1972 Rules", draft-ietf-ldapbis-syntaxes-xx.txt, (a work in 1973 progress). 1975 [TCP] Postel, J., "Transmission Control Protocol", STD7 and RFC 1976 793, September 1981 1978 [TLS] Dierks, T. and C. Allen. "The TLS Protocol Version 1.1", 1979 draft-ietf-tls-rfc2246-bis-xx.txt, a work in progress. 1981 [Unicode] The Unicode Consortium, "The Unicode Standard, Version 1982 3.2.0" is defined by "The Unicode Standard, Version 3.0" 1983 (Reading, MA, Addison-Wesley, 2000. ISBN 0-201-61633-5), 1984 as amended by the "Unicode Standard Annex #27: Unicode 1985 3.1" (http://www.unicode.org/reports/tr27/) and by the 1986 "Unicode Standard Annex #28: Unicode 3.2" 1987 (http://www.unicode.org/reports/tr28/). 1989 [URI] Berners-Lee, T., Fielding, R., and L. Masinter Uniform 1990 Resource Identifiers (URI): Generic Syntax", RFC 2396, 1991 August 1998. 1993 [UTF-8] Yergeau, F., "UTF-8, a transformation format of Unicode 1994 and ISO 10646", STD63 and RFC3629. 1996 [X.500] ITU-T Rec. X.500, "The Directory: Overview of Concepts, 1997 Models and Service", 1993. 1999 [X.501] ITU-T Rec. X.501, "The Directory: Models", 1993. 2001 [X.511] ITU-T Rec. X.511, "The Directory: Abstract Service 2002 Definition", 1993. 2004 9. Informative References 2006 [CERT] the CERT(R) Center, (http://www.cert.org) 2008 10. IANA Considerations 2009 Lightweight Directory Access Protocol Version 3 2011 It is requested that the Internet Assigned Numbers Authority (IANA) 2012 update the occurrence of "RFC XXXX" in Appendix B with this RFC 2013 number at publication. 2015 11. Editor's Address 2017 Jim Sermersheim 2018 Novell, Inc. 2019 1800 South Novell Place 2020 Provo, Utah 84606, USA 2021 jimse@novell.com 2022 +1 801 861-3088 2023 Lightweight Directory Access Protocol Version 3 2025 Appendix A - LDAP Result Codes 2027 This normative appendix details additional considerations regarding 2028 LDAP result codes and provides a brief, general description of each 2029 LDAP result code enumerated in Section 4.1.10. 2031 Additional result codes MAY be defined for use with extensions 2032 [LDAPIANA]. Client implementations SHALL treat any result code which 2033 they do not recognize as an unknown error condition. 2035 A.1 Non-Error Result Codes 2037 These result codes (called "non-error" result codes) do not indicate 2038 an error condition: 2039 success (0), 2040 compareTrue (6), 2041 compareFalse (7), 2042 referral (10), and 2043 saslBindInProgress (14). 2045 The success, compareTrue, and compare result codes indicate 2046 successful completion (and, hence, are referred to as "successful" 2047 result codes). 2049 The referral and saslBindInProgress result codes indicate the client 2050 is required to take additional action to complete the operation 2052 A.2 Result Codes 2054 Existing LDAP result codes are described as follows: 2056 success (0) 2057 Indicates the successful completion of an operation. Note: 2058 this code is not used with the compare operation. See 2059 compareTrue (5) and compareFalse (6). 2061 operationsError (1) 2062 Indicates that the operation is not properly sequenced with 2063 relation to other operations (of same or different type). 2065 For example, this code is returned if the client attempts to 2066 StartTLS [RFC2246] while there are other operations 2067 outstanding or if TLS was already established. 2069 protocolError (2) 2070 Indicates the server received data which has incorrect 2071 structure. 2073 For bind operation only, this code is also used to indicate 2074 that the server does not support the requested protocol 2075 version. 2077 timeLimitExceeded (3) 2078 Lightweight Directory Access Protocol Version 3 2080 Indicates that the time limit specified by the client was 2081 exceeded before the operation could be completed. 2083 sizeLimitExceeded (4) 2084 Indicates that the size limit specified by the client was 2085 exceeded before the operation could be completed. 2087 compareFalse (5) 2088 Indicates that the compare operation has successfully 2089 completed and the assertion has evaluated to FALSE. 2091 compareTrue (6) 2092 Indicates that the compare operation has successfully 2093 completed and the assertion has evaluated to TRUE. 2095 authMethodNotSupported (7) 2096 Indicates that the authentication method or mechanism is not 2097 supported. 2099 strongAuthRequired (8) 2100 Indicates that the server has detected that an established 2101 security association between the client and server has 2102 unexpectedly failed or been compromised, or that the server 2103 now requires the client to authenticate using a strong(er) 2104 mechanism. 2106 referral (10) 2107 Indicates that a referral needs to be chased to complete the 2108 operation (see Section 4.1.11). 2110 adminLimitExceeded (11) 2111 Indicates that an administrative limit has been exceeded. 2113 unavailableCriticalExtension (12) 2114 Indicates that the server is unable or unwilling to perform a 2115 critical extension (see Section 4.1.12). 2117 confidentialityRequired (13) 2118 Indicates that data confidentiality protections are required. 2120 saslBindInProgress (14) 2121 Indicates the server requires the client to send a new bind 2122 request, with the same SASL mechanism, to continue the 2123 authentication process (see Section 4.2). 2125 noSuchAttribute (16) 2126 Indicates that the named entry does not contain the specified 2127 attribute or attribute value. 2129 undefinedAttributeType (17) 2130 Indicates that a request field contains an unrecognized 2131 attribute description. 2133 inappropriateMatching (18) 2134 Lightweight Directory Access Protocol Version 3 2136 Indicates that an attempt was made, e.g. in a filter, to use 2137 a matching rule not defined for the attribute type concerned. 2139 constraintViolation (19) 2140 Indicates that the client supplied an attribute value which 2141 does not conform to the constraints placed upon it by the 2142 data model. 2144 For example, this code is returned when multiple values are 2145 supplied to an attribute which has a SINGLE-VALUE constraint. 2147 attributeOrValueExists (20) 2148 Indicates that the client supplied an attribute or value to 2149 be added to an entry, but the attribute or value already 2150 exists. 2152 invalidAttributeSyntax (21) 2153 Indicates that a purported attribute value does not conform 2154 to the syntax of the attribute. 2156 noSuchObject (32) 2157 Indicates that the object does not exist in the DIT. 2159 aliasProblem (33) 2160 Indicates that an alias problem has occurred. For example, 2161 the code may used to indicate an alias has been dereferenced 2162 which names no object. 2164 invalidDNSyntax (34) 2165 Indicates that an LDAPDN or RelativeLDAPDN field (e.g. search 2166 base, target entry, ModifyDN newrdn, etc.) of a request does 2167 not conform to the required syntax or contains attribute 2168 values which do not conform to the syntax of the attribute's 2169 type. 2171 aliasDereferencingProblem (36) 2172 Indicates that a problem occurred while dereferencing an 2173 alias. Typically an alias was encountered in a situation 2174 where it was not allowed or where access was denied. 2176 inappropriateAuthentication (48) 2177 Indicates the server requires the client which had attempted 2178 to bind anonymously or without supplying credentials to 2179 provide some form of credentials. 2181 invalidCredentials (49) 2182 Indicates that the provided credentials (e.g. the user's name 2183 and password) are invalid. 2185 insufficientAccessRights (50) 2186 Indicates that the client does not have sufficient access 2187 rights to perform the operation. 2189 busy (51) 2190 Lightweight Directory Access Protocol Version 3 2192 Indicates that the server is too busy to service the 2193 operation. 2195 unavailable (52) 2196 Indicates that the server is shutting down or a subsystem 2197 necessary to complete the operation is offline. 2199 unwillingToPerform (53) 2200 Indicates that the server is unwilling to perform the 2201 operation. 2203 loopDetect (54) 2204 Indicates that the server has detected an internal loop. 2206 namingViolation (64) 2207 Indicates that the entry's name violates naming restrictions. 2209 objectClassViolation (65) 2210 Indicates that the entry violates object class restrictions. 2212 notAllowedOnNonLeaf (66) 2213 Indicates that the operation is inappropriately acting upon a 2214 non-leaf entry. 2216 notAllowedOnRDN (67) 2217 Indicates that the operation is inappropriately attempting to 2218 remove a value which forms the entry's relative distinguished 2219 name. 2221 entryAlreadyExists (68) 2222 Indicates that the request cannot be fulfilled (added, moved, 2223 or renamed) as the target entry already exists. 2225 objectClassModsProhibited (69) 2226 Indicates that an attempt to modify the object class(es) of 2227 an entry's objectClass attribute is prohibited. 2229 For example, this code is returned when a client attempts to 2230 modify the structural object class of an entry. 2232 affectsMultipleDSAs (71) 2233 Indicates that the operation cannot be completed as it 2234 affects multiple servers (DSAs). 2236 other (80) 2237 Indicates the server has encountered an internal error. 2239 Lightweight Directory Access Protocol Version 3 2241 Appendix B - Complete ASN.1 Definition 2243 This appendix is normative. 2245 Lightweight-Directory-Access-Protocol-V3 2246 -- Copyright (C) The Internet Society (2003). This version of 2247 -- this ASN.1 module is part of RFC XXXX; see the RFC itself 2248 -- for full legal notices. 2249 DEFINITIONS 2250 IMPLICIT TAGS 2251 EXTENSIBILITY IMPLIED ::= 2253 BEGIN 2255 LDAPMessage ::= SEQUENCE { 2256 messageID MessageID, 2257 protocolOp CHOICE { 2258 bindRequest BindRequest, 2259 bindResponse BindResponse, 2260 unbindRequest UnbindRequest, 2261 searchRequest SearchRequest, 2262 searchResEntry SearchResultEntry, 2263 searchResDone SearchResultDone, 2264 searchResRef SearchResultReference, 2265 modifyRequest ModifyRequest, 2266 modifyResponse ModifyResponse, 2267 addRequest AddRequest, 2268 addResponse AddResponse, 2269 delRequest DelRequest, 2270 delResponse DelResponse, 2271 modDNRequest ModifyDNRequest, 2272 modDNResponse ModifyDNResponse, 2273 compareRequest CompareRequest, 2274 compareResponse CompareResponse, 2275 abandonRequest AbandonRequest, 2276 extendedReq ExtendedRequest, 2277 extendedResp ExtendedResponse, 2278 ... }, 2279 controls [0] Controls OPTIONAL } 2281 MessageID ::= INTEGER (0 .. maxInt) 2283 maxInt INTEGER ::= 2147483647 -- (2^^31 - 1) -- 2285 LDAPString ::= OCTET STRING -- UTF-8 encoded, 2286 -- [ISO10646] characters 2288 LDAPOID ::= OCTET STRING -- Constrained to [Models] 2290 LDAPDN ::= LDAPString 2292 RelativeLDAPDN ::= LDAPString 2294 AttributeDescription ::= LDAPString 2295 Lightweight Directory Access Protocol Version 3 2297 -- Constrained to 2298 -- [Models] 2300 AttributeValue ::= OCTET STRING 2302 AttributeValueAssertion ::= SEQUENCE { 2303 attributeDesc AttributeDescription, 2304 assertionValue AssertionValue } 2306 AssertionValue ::= OCTET STRING 2308 PartialAttribute ::= SEQUENCE { 2309 type AttributeDescription, 2310 vals SET OF value AttributeValue } 2312 Attribute ::= PartialAttribute(WITH COMPONENTS { 2313 ..., 2314 vals (SIZE(1..MAX))}) 2316 MatchingRuleId ::= LDAPString 2318 LDAPResult ::= SEQUENCE { 2319 resultCode ENUMERATED { 2320 success (0), 2321 operationsError (1), 2322 protocolError (2), 2323 timeLimitExceeded (3), 2324 sizeLimitExceeded (4), 2325 compareFalse (5), 2326 compareTrue (6), 2327 authMethodNotSupported (7), 2328 strongAuthRequired (8), 2329 -- 9 reserved -- 2330 referral (10), 2331 adminLimitExceeded (11), 2332 unavailableCriticalExtension (12), 2333 confidentialityRequired (13), 2334 saslBindInProgress (14), 2335 noSuchAttribute (16), 2336 undefinedAttributeType (17), 2337 inappropriateMatching (18), 2338 constraintViolation (19), 2339 attributeOrValueExists (20), 2340 invalidAttributeSyntax (21), 2341 -- 22-31 unused -- 2342 noSuchObject (32), 2343 aliasProblem (33), 2344 invalidDNSyntax (34), 2345 -- 35 reserved for undefined isLeaf -- 2346 aliasDereferencingProblem (36), 2347 -- 37-47 unused -- 2348 inappropriateAuthentication (48), 2349 invalidCredentials (49), 2350 insufficientAccessRights (50), 2351 Lightweight Directory Access Protocol Version 3 2353 busy (51), 2354 unavailable (52), 2355 unwillingToPerform (53), 2356 loopDetect (54), 2357 -- 55-63 unused -- 2358 namingViolation (64), 2359 objectClassViolation (65), 2360 notAllowedOnNonLeaf (66), 2361 notAllowedOnRDN (67), 2362 entryAlreadyExists (68), 2363 objectClassModsProhibited (69), 2364 -- 70 reserved for CLDAP -- 2365 affectsMultipleDSAs (71), 2366 -- 72-79 unused -- 2367 other (80), 2368 ... }, 2369 -- 81-90 reserved for APIs -- 2370 matchedDN LDAPDN, 2371 diagnosticMessage LDAPString, 2372 referral [3] Referral OPTIONAL } 2374 Referral ::= SEQUENCE SIZE (1..MAX) OF uri URI 2376 URI ::= LDAPString -- limited to characters permitted in 2377 -- URIs 2379 Controls ::= SEQUENCE OF control Control 2381 Control ::= SEQUENCE { 2382 controlType LDAPOID, 2383 criticality BOOLEAN DEFAULT FALSE, 2384 controlValue OCTET STRING OPTIONAL } 2386 BindRequest ::= [APPLICATION 0] SEQUENCE { 2387 version INTEGER (1 .. 127), 2388 name LDAPDN, 2389 authentication AuthenticationChoice } 2391 AuthenticationChoice ::= CHOICE { 2392 simple [0] OCTET STRING, 2393 -- 1 and 2 reserved 2394 sasl [3] SaslCredentials, 2395 ... } 2397 SaslCredentials ::= SEQUENCE { 2398 mechanism LDAPString, 2399 credentials OCTET STRING OPTIONAL } 2401 BindResponse ::= [APPLICATION 1] SEQUENCE { 2402 COMPONENTS OF LDAPResult, 2403 serverSaslCreds [7] OCTET STRING OPTIONAL } 2405 UnbindRequest ::= [APPLICATION 2] NULL 2406 Lightweight Directory Access Protocol Version 3 2408 SearchRequest ::= [APPLICATION 3] SEQUENCE { 2409 baseObject LDAPDN, 2410 scope ENUMERATED { 2411 baseObject (0), 2412 singleLevel (1), 2413 wholeSubtree (2) }, 2414 derefAliases ENUMERATED { 2415 neverDerefAliases (0), 2416 derefInSearching (1), 2417 derefFindingBaseObj (2), 2418 derefAlways (3) }, 2419 sizeLimit INTEGER (0 .. maxInt), 2420 timeLimit INTEGER (0 .. maxInt), 2421 typesOnly BOOLEAN, 2422 filter Filter, 2423 attributes AttributeSelection } 2425 AttributeSelection ::= SEQUENCE OF selection LDAPString 2427 Filter ::= CHOICE { 2428 and [0] SET SIZE (1..MAX) OF filter Filter, 2429 or [1] SET SIZE (1..MAX) OF filter Filter, 2430 not [2] Filter, 2431 equalityMatch [3] AttributeValueAssertion, 2432 substrings [4] SubstringFilter, 2433 greaterOrEqual [5] AttributeValueAssertion, 2434 lessOrEqual [6] AttributeValueAssertion, 2435 present [7] AttributeDescription, 2436 approxMatch [8] AttributeValueAssertion, 2437 extensibleMatch [9] MatchingRuleAssertion } 2439 SubstringFilter ::= SEQUENCE { 2440 type AttributeDescription, 2441 -- at least one must be present, 2442 -- initial and final can occur at most once 2443 substrings SEQUENCE SIZE (1..MAX) OF substring CHOICE { 2444 initial [0] AssertionValue, 2445 any [1] AssertionValue, 2446 final [2] AssertionValue } } 2448 MatchingRuleAssertion ::= SEQUENCE { 2449 matchingRule [1] MatchingRuleId OPTIONAL, 2450 type [2] AttributeDescription OPTIONAL, 2451 matchValue [3] AssertionValue, 2452 dnAttributes [4] BOOLEAN DEFAULT FALSE } 2454 SearchResultEntry ::= [APPLICATION 4] SEQUENCE { 2455 objectName LDAPDN, 2456 attributes PartialAttributeList } 2458 PartialAttributeList ::= SEQUENCE OF 2459 partialAttribute PartialAttribute 2461 SearchResultReference ::= [APPLICATION 19] SEQUENCE 2462 Lightweight Directory Access Protocol Version 3 2464 SIZE (1..MAX) OF uri URI 2466 SearchResultDone ::= [APPLICATION 5] LDAPResult 2468 ModifyRequest ::= [APPLICATION 6] SEQUENCE { 2469 object LDAPDN, 2470 changes SEQUENCE OF change SEQUENCE { 2471 operation ENUMERATED { 2472 add (0), 2473 delete (1), 2474 replace (2) }, 2475 modification PartialAttribute } } 2477 ModifyResponse ::= [APPLICATION 7] LDAPResult 2479 AddRequest ::= [APPLICATION 8] SEQUENCE { 2480 entry LDAPDN, 2481 attributes AttributeList } 2483 AttributeList ::= SEQUENCE OF attribute Attribute 2485 AddResponse ::= [APPLICATION 9] LDAPResult 2487 DelRequest ::= [APPLICATION 10] LDAPDN 2489 DelResponse ::= [APPLICATION 11] LDAPResult 2491 ModifyDNRequest ::= [APPLICATION 12] SEQUENCE { 2492 entry LDAPDN, 2493 newrdn RelativeLDAPDN, 2494 deleteoldrdn BOOLEAN, 2495 newSuperior [0] LDAPDN OPTIONAL } 2497 ModifyDNResponse ::= [APPLICATION 13] LDAPResult 2499 CompareRequest ::= [APPLICATION 14] SEQUENCE { 2500 entry LDAPDN, 2501 ava AttributeValueAssertion } 2503 CompareResponse ::= [APPLICATION 15] LDAPResult 2505 AbandonRequest ::= [APPLICATION 16] MessageID 2507 ExtendedRequest ::= [APPLICATION 23] SEQUENCE { 2508 requestName [0] LDAPOID, 2509 requestValue [1] OCTET STRING OPTIONAL } 2511 ExtendedResponse ::= [APPLICATION 24] SEQUENCE { 2512 COMPONENTS OF LDAPResult, 2513 responseName [10] LDAPOID OPTIONAL, 2514 responseValue [11] OCTET STRING OPTIONAL } 2516 END 2517 Lightweight Directory Access Protocol Version 3 2519 Appendix C - Changes 2521 This appendix is non-normative. 2523 This appendix summarizes substantive changes made to RFC 2251 and RFC 2524 2830. 2526 C.1 Changes made to made to RFC 2251: 2528 This section summarizes the substantive changes made to Sections 1, 2529 2, 3.1, and 4 through the remainder of RFC 2251. Readers should 2530 consult [Models] and [AuthMeth] for summaries of changes to other 2531 sections. 2533 C.1.1 Section 1 2535 - Removed IESG note. Post publication of RFC 2251, mandatory LDAP 2536 authentication mechanisms have been standardized which are 2537 sufficient to remove this note. See [AuthMeth] for authentication 2538 mechanisms. 2540 C.1.2 Section 3.1 and others 2542 - Removed notes giving history between LDAP v1, v2 and v3. Instead, 2543 added sufficient language so that this document can stand on its 2544 own. 2546 C.1.3 Section 4 2548 - Clarified where the extensibility features of ASN.1 apply to the 2549 protocol. This change also affected various ASN.1 types. 2550 - Removed the requirement that servers which implement version 3 or 2551 later MUST provide the supportedLDAPVersion attribute. This 2552 statement provided no interoperability advantages. 2554 C.1.4 Section 4.1.1 2556 - There was a mandatory requirement for the server to return a 2557 Notice of Disconnection and drop the connection when a PDU is 2558 malformed in a certain way. This has been clarified such that the 2559 server SHOULD return the Notice of Disconnection, and MUST drop 2560 the connection. 2562 C.1.5 Section 4.1.1.1 2564 - Clarified that the messageID of requests MUST be non-zero. 2566 Lightweight Directory Access Protocol Version 3 2568 - Clarified when it is and isn't appropriate to return an already 2569 used message id. RFC 2251 accidentally imposed synchronous server 2570 behavior in its wording of this. 2572 C.1.6 Section 4.1.2 2574 - Stated that LDAPOID is constrained to from [Models]. 2576 C.1.7 Section 4.1.5.1 2578 - Removed the Binary Option from the specification. There are 2579 numerous interoperability problems associated with this method of 2580 alternate attribute type encoding. Work to specify a suitable 2581 replacement is ongoing. 2583 C.1.8 Section 4.1.6 2585 - Removed references to the "binary" encoding as it has been removed 2586 from the specification. 2588 C.1.9 Section 4.1.7 2590 - Removed references to the "binary" encoding as it has been removed 2591 from the specification. 2593 C.1.10 Section 4.1.8 2595 - Combined the definitions of PartialAttribute and Attribute here, 2596 and defined Attribute in terms of PartialAttribute. 2598 C.1.11 Section 4.1.10 2600 - Renamed "errorMessage" to "diagnosticMessage" as it is allowed to 2601 be sent for non-error results. 2602 - Moved some language into Appendix A, and refer the reader there. 2603 - Allowed matchedDN to be present for other result codes than those 2604 listed in RFC 2251. 2606 C.1.12 Section 4.1.11 2608 - Defined referrals in terms of URIs rather than URLs. 2609 - Removed the requirement that all referral URIs MUST be equally 2610 capable of progressing the operation. The statement was ambiguous 2611 and provided no instructions on how to carry it out. 2612 - Added the requirement that clients MUST NOT loop between servers. 2613 - Clarified the instructions for using LDAPURLs in referrals, and in 2614 doing so added a recommendation that the scope part be present. 2616 Lightweight Directory Access Protocol Version 3 2618 C.1.13 Section 4.1.12 2620 - Specified how control values defined in terms of ASN.1 are to be 2621 encoded. 2622 - Added language regarding combinations of controls on a message. 2623 - Changed "The server MUST be prepared" to "Implementations MUST be 2624 prepared" in the eighth paragraph to reflect that both client and 2625 server implementations must be able to handle this (as both parse 2626 controls). 2628 C.1.14 Section 4.2 2630 - Mandated that servers return protocolError when the version is not 2631 supported. 2632 - Clarified behavior when the simple authentication is used, the 2633 name is empty and the password is non-empty. 2634 - Required servers to not dereference aliases for bind. This was 2635 added for consistency with other operations and to help ensure 2636 data consistency 2637 - Required that textual passwords be transferred as UTF-8 encoded 2638 Unicode, and added recommendations on string preparation. This was 2639 to help ensure interoperability of passwords being sent from 2640 different clients. 2642 C.1.15 Section 4.2.1 2644 - This section was largely reorganized for readability and language 2645 was added to clarify the authentication state of failed and 2646 abandoned bind operations. 2647 - Removed: "If a SASL transfer encryption or integrity mechanism has 2648 been negotiated, that mechanism does not support the changing of 2649 credentials from one identity to another, then the client MUST 2650 instead establish a new connection." 2651 Each SASL negotiation is, generally, independent of other SASL 2652 negotiations. If there were dependencies between multiple 2653 negotiations of a particular mechanism, the mechanism technical 2654 specification should detail how applications are to deal with 2655 them. LDAP should not require any special handling. And if an LDAP 2656 client had used such a mechanism, it would have the option of 2657 using another mechanism. 2658 - Dropped MUST imperative in paragraph 3 to align with [Keywords]. 2660 C.1.16 Section 4.2.3 2662 - Moved most error-related text to Appendix A, and added text 2663 regarding certain errors used in conjunction with the bind 2664 operation. 2665 - Prohibited the server from specifying serverSaslCreds when not 2666 appropriate. 2668 Lightweight Directory Access Protocol Version 3 2670 C.1.17 Section 4.3 2672 - Required both peers to cease transmission and close the connection 2673 for the unbind operation. 2675 C.1.18 Section 4.4 2677 - Added instructions for future specifications of Unsolicited 2678 Notifications. 2680 C.1.19 Section 4.5.1 2682 - SearchRequest attributes is now defined as an AttributeSelection 2683 type rather than AttributeDescriptionList. 2684 - The Filter choices 'and' and 'or', and the SubstringFilter 2685 substrings types are now defined with a lower bound of 1. 2686 - The SubstringFilter substrings 'initial, 'any', and 'final' types 2687 are now AssertionValue rather than LDAPString. 2688 - Clarified the semantics of the derefAliases choices. 2689 - Added instructions for equalityMatch, substrings, greaterOrEqual, 2690 lessOrEqual, and approxMatch. 2692 C.1.20 Section 4.5.2 2694 - Recommended that servers not use attribute short names when it 2695 knows they are ambiguous or may cause interoperability problems. 2696 - Removed all mention of ExtendedResponse due to lack of 2697 implementation. 2699 C.1.21 Section 4.5.3 2701 - Made changes similar to those made to Section 4.1.11. 2703 C.1.22 Section 4.5.3.1 2705 - Fixed examples to adhere to changes made to Section 4.5.3. 2707 C.1.23 Section 4.6 2709 - Removed restriction that required an equality match filter in 2710 order to perform value delete modifications. It is sufficiently 2711 documented that in absence of an equality matching rule, octet 2712 equality is used. 2713 - Replaced AttributeTypeAndValues with Attribute as they are 2714 equivalent. 2716 Lightweight Directory Access Protocol Version 3 2718 - Clarified what type of modification changes might temporarily 2719 violate schema. 2721 C.1.24 Section 4.9 2723 - Required servers to not dereference aliases for modify DN. This 2724 was added for consistency with other operations and to help ensure 2725 data consistency. 2726 - Allow modify DN to fail when moving between naming contexts. 2728 C.1.25 Section 4.10 2730 - Clarified the semantics of Compare when the attribute is not 2731 present and when it is unknown. 2732 - Required servers to not dereference aliases for compare. This was 2733 added for consistency with other operations and to help ensure 2734 data consistency. 2736 C.1.26 Section 4.11 2738 - Explained that since abandon returns no response, clients hould 2739 not use it if they need to know the outcome. 2740 - Specified that Abandon and Unbind cannot be abandoned. 2742 C.1.27 Section 4.12 2744 - Specified how values of extended operations defined in terms of 2745 ASN.1 are to be encoded. 2746 - Added instructions on what extended operation specifications 2747 consist of. 2748 - Added a recommendation that servers advertise supported extended 2749 operations. 2751 C.1.28 Section 5.2 2753 - Moved referral-specific instructions into referral-related 2754 sections. 2756 C.1.29 Section 7 2758 - Reworded notes regarding SASL not protecting certain aspects of 2759 the LDAP bind PDU. 2760 - Noted that Servers are encouraged to prevent directory 2761 modifications by clients that have authenticated anonymously 2762 [AuthMeth]. 2763 - Added a note regarding the scenario where an identity is changed 2764 (deleted, privileges or credentials modified, etc.). 2766 Lightweight Directory Access Protocol Version 3 2768 - Warned against following referrals that may have been injected in 2769 the data stream. 2770 - Added a note regarding malformed and long encodings. 2772 C.1.30 Appendix A 2774 - Added "EXTESIBILITY IMPLIED" to ASN.1 definition. 2775 - Removed AttributeType. It is not used. 2777 C.2 Changes made to made to RFC 2830: 2779 This section summarizes the substantive changes made to Sections of 2780 RFC 2830. Readers should consult [AuthMeth] for summaries of changes 2781 to other sections. 2783 C.2.1 Section 2.3 2785 - Removed wording indicating that referrals can be returned from 2786 StartTLS 2788 C.2.1 Section 4.13.3.1 2790 - Reworded most of this section and added the requirement that after 2791 the TLS connection has been closed, the server MUST NOT send 2792 responses to any request message received before the TLS closure. 2794 Lightweight Directory Access Protocol Version 3 2796 Intellectual Property Rights 2798 The IETF takes no position regarding the validity or scope of any 2799 intellectual property or other rights that might be claimed to 2800 pertain to the implementation or use of the technology described in 2801 this document or the extent to which any license under such rights 2802 might or might not be available; neither does it represent that it 2803 has made any effort to identify any such rights. Information on the 2804 IETF's procedures with respect to rights in standards-track and 2805 standards-related documentation can be found in BCP-11. Copies of 2806 claims of rights made available for publication and any assurances of 2807 licenses to be made available, or the result of an attempt made to 2808 obtain a general license or permission for the use of such 2809 proprietary rights by implementors or users of this specification can 2810 be obtained from the IETF Secretariat. 2812 The IETF invites any interested party to bring to its attention any 2813 copyrights, patents or patent applications, or other proprietary 2814 rights which may cover technology that may be required to practice 2815 this standard. Please address the information to the IETF Executive 2816 Director. 2818 Full Copyright Statement 2820 Copyright (C) The Internet Society (2003). All Rights Reserved. 2822 This document and translations of it may be copied and furnished to 2823 others, and derivative works that comment on or otherwise explain it 2824 or assist in its implementation may be prepared, copied, published 2825 and distributed, in whole or in part, without restriction of any 2826 kind, provided that the above copyright notice and this paragraph are 2827 included on all such copies and derivative works. However, this 2828 document itself may not be modified in any way, such as by removing 2829 the copyright notice or references to the Internet Society or other 2830 Internet organizations, except as needed for the purpose of 2831 developing Internet standards in which case the procedures for 2832 copyrights defined in the Internet Standards process must be 2833 followed, or as required to translate it into languages other than 2834 English. 2836 The limited permissions granted above are perpetual and will not be 2837 revoked by the Internet Society or its successors or assigns. 2839 This document and the information contained herein is provided on an 2840 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 2841 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 2842 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION 2843 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 2844 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.