<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" submissionType="IETF" docName="draft-khan-ldap-bind-return-dn-00" category="std" ipr="trust200902" obsoletes="" updates="" xml:lang="en" symRefs="false" sortRefs="true" tocInclude="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.31.0 -->
  <!-- Generated by id2xml 1.5.2 on 2025-12-18T20:30:11Z -->
	<front>
    <title abbrev="LDAP Bind Response Extension for Returni">LDAP Bind Response Extension for Returning DN and Attributes</title>
    <seriesInfo name="Internet-Draft" value="draft-khan-ldap-bind-return-dn-00"/>
    <author initials="J." surname="Khan" fullname="J. Khan">
      <organization>DXC Technology</organization>
      <address>
        <postal>
          <street>Vancouver, BC, Canada</street>
        </postal>
      </address>
    </author>
    <date year="2025" month="December" day="18"/>
    <abstract>
      <t>
   This document proposes an extension to the LDAP Bind operation to
   optionally return the authenticated subject’s Distinguished Name (DN)
   and selected attributes.  The goal is to reduce the number of client-
   server round trips required to obtain user identity information after
   authentication.</t>
    </abstract>
  </front>
  <middle>
    <section anchor="sect-1" numbered="true" toc="default">
      <name>Introduction</name>
      <t>
   In current LDAP practice, a client must perform at least two
   operations to authenticate and retrieve the DN of the subject:</t>
      <ol spacing="normal" type="1"><li>
          <t>Bind Request: The client authenticates using a DN and
       credentials.</t>
        </li>
        <li>
          <t>Search Request: The client issues a search query to retrieve the
       DN and attributes of the authenticated subject.</t>
        </li>
      </ol>
      <t>
   This two-step process introduces unnecessary latency and complexity.
   By allowing the Bind response itself to return the DN and optionally
   attributes, the number of calls is reduced, improving efficiency for
   applications that need immediate access to identity information.</t>
    </section>
    <section anchor="sect-2" numbered="true" toc="default">
      <name>Motivation</name>
      <t>
   Many modern applications, including single sign-on (SSO) systems and
   microservices, require immediate access to user identity attributes
   after authentication.  The current LDAP model requires a follow-up
   search operation, which adds latency and complexity.  This extension
   simplifies client logic and reduces round trips.</t>
    </section>
    <section anchor="sect-3" numbered="true" toc="default">
      <name>Specification</name>
      <section anchor="sect-3.1" numbered="true" toc="default">
        <name>Bind Request Control</name>
        <t>
   This document defines a new optional LDAP control for the Bind
   request:</t>
        <ul spacing="normal">
          <li>
            <t>Control OID: 1.3.6.1.4.1.xxx.yyy.zzz (to be assigned)</t>
          </li>
          <li>
            <t>Criticality: OPTIONAL</t>
          </li>
          <li>
            <t>Control Value: An ASN.1-encoded sequence of attribute descriptions
      requested by the client.  If the sequence is empty or absent, the
      server SHALL return only the DN.</t>
          </li>
        </ul>
      </section>
      <section anchor="sect-3.2" numbered="true" toc="default">
        <name>Bind Response Augmentation</name>
        <t>
   If the server supports this extension and the Bind operation
   succeeds, the Bind response SHALL include an attached response
   control carrying:</t>
        <ul spacing="normal">
          <li>
            <t>The Distinguished Name (DN) of the authenticated (authorization)
      identity.</t>
          </li>
          <li>
            <t>The requested attributes, subject to applicable access control and
      privacy policies.</t>
          </li>
          <li>
            <t>Attributes not permitted by policy SHALL be omitted; the server
      MAY include per-attribute error indicators within the control
      value.</t>
          </li>
        </ul>
        <t>
   If the Bind fails, the server SHALL NOT include this response
   control.</t>
      </section>
      <section anchor="sect-3.3" numbered="true" toc="default">
        <name>Control Value and Encoding</name>
        <t>
   The request and response control values are defined using ASN.1:</t>
        <artwork name="" type="" align="left" alt=""><![CDATA[
RequestControlValue ::= SEQUENCE OF AttributeDescription
ResponseControlValue ::= SEQUENCE {
    authzDN      LDAPDN,
    attributes   SEQUENCE OF PartialAttribute OPTIONAL
}
]]></artwork>
        <t>
   Where AttributeDescription, LDAPDN, and PartialAttribute are as
   defined in RFC 4511.  Servers SHOULD preserve attribute ordering
   requested by the client where feasible.</t>
      </section>
    </section>
    <section anchor="sect-4" numbered="true" toc="default">
      <name>Examples</name>
      <section anchor="sect-4.1" numbered="true" toc="default">
        <name>Current Workflow (RFC 4511 behavior)</name>
        <artwork name="" type="" align="left" alt=""><![CDATA[
Client                          Server
------                          ------
Bind Request  ---------------->
                                Bind Response (success)
Search Request ---------------->
                                Search Response (dn + attributes)
]]></artwork>
      </section>
      <section anchor="sect-4.2" numbered="true" toc="default">
        <name>Proposed Workflow (with this extension)</name>
        <artwork name="" type="" align="left" alt=""><![CDATA[
Client                          Server
------                          ------
Bind Request (with control) -->
                                Bind Response (dn + attributes)
]]></artwork>
      </section>
      <section anchor="sect-4.3" numbered="true" toc="default">
        <name>Attribute Selection Example</name>
        <t>
   Request control value: ["givenName", "mail"]</t>
        <t>
   Bind Response control value:</t>
        <dl newline="true" spacing="normal" indent="2">
          <dt>authzDN: uid=jdoe,ou=People,dc=example,dc=com</dt>
          <dd>
	attributes:
     givenName: John
     mail: jdoe@example.com
	</dd>
        </dl>
      </section>
    </section>
    <section anchor="sect-5" numbered="true" toc="default">
      <name>Advantages</name>
      <ul spacing="normal">
        <li>
          <t>Reduced number of calls: Authentication and identity retrieval in
      a single step.</t>
        </li>
        <li>
          <t>Lower latency: Fewer round trips between client and server.</t>
        </li>
        <li>
          <t>Simplified client logic: No need for a follow-up search.</t>
        </li>
        <li>
          <t>Clearer authorization identity handling: DN returned alongside
      selected attributes.</t>
        </li>
      </ul>
    </section>
    <section anchor="sect-6" numbered="true" toc="default">
      <name>Security Considerations</name>
      <ul spacing="normal">
        <li>
          <t>Access Control: Servers MUST enforce authorization and access
      control policies prior to returning any attribute in the Bind
      response control.</t>
        </li>
        <li>
          <t>Sensitive Data: Sensitive attributes (e.g., userPassword, secrets,
      tokens) MUST NOT be returned.</t>
        </li>
        <li>
          <t>Privacy: Servers SHOULD minimize data returned by default and
      honor least privilege.</t>
        </li>
        <li>
          <t>Integrity and Confidentiality: Use of StartTLS or LDAPS is
      RECOMMENDED to protect Bind credentials and returned attributes.</t>
        </li>
        <li>
          <t>Auditing: Servers SHOULD log the use of this control, subject to
      privacy law and organizational policy.</t>
        </li>
        <li>
          <t>Downgrade/Capability: Clients MUST NOT assume support; they SHOULD
      fall back to a search when the server does not advertise or honor
      the control.</t>
        </li>
      </ul>
    </section>
    <section anchor="sect-7" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <t>
   IANA is requested to assign a new LDAP control OID under the
   appropriate IANA registry.  The descriptive name is:</t>
      <t>
   LDAP Bind Response Extension for Returning DN and Attributes</t>
      <t>
   The control is suitable for Standards Track registration.</t>
    </section>
    <section anchor="sect-8" numbered="true" toc="default">
      <name>Relationship to Existing RFCs</name>
      <t>
   This document defines an LDAP control that extends the Bind operation
   specified in RFC 4511 (“Lightweight Directory Access Protocol (LDAP):
   The Protocol”).  RFC 4511 defines the Bind request and response as an
   authentication mechanism, with the Bind response limited to success
   or failure indicators.  It does not provide a mechanism for returning
   the Distinguished Name (DN) or attributes of the authenticated
   subject.</t>
      <t>
   The closest related work is RFC 3829 (“Lightweight Directory Access
   Protocol (LDAP) Authorization Identity Request and Response
   Controls”), which introduces a control allowing a client to request
   the authorization identity established by the Bind.  RFC 3829 enables
   a client to confirm the identity string (such as a DN or other
   identifier) but does not return arbitrary attributes of the subject
   entry.</t>
      <t>
   This document differs from RFC 3829 in that it allows the Bind
   response to return not only the DN but also selected attributes of
   the authenticated subject, subject to access control policies.  Thus,
   this proposal complements RFC 3829 by extending the Bind operation to
   cover attribute retrieval, reducing the need for a subsequent search
   operation.</t>
    </section>
    <section anchor="sect-9" numbered="true" toc="default">
      <name>Conclusion</name>
      <t>
   This document proposes an LDAP Bind extension that returns the DN and
   optionally attributes of the authenticated subject.  By collapsing
   authentication and identity retrieval into a single operation, the
   protocol reduces overhead and improves efficiency for client
   applications.</t>
    </section>
  </middle>
  <back>
    <section anchor="sect-a" numbered="true" toc="default">
      <name>Change Log</name>
      <artwork name="" type="" align="left" alt=""><![CDATA[
draft-khan-ldap-bind-return-dn-00
- Initial version of the document.
- Defined Bind request/response extension and ASN.1 control values.
- Added Motivation and Examples, including ASCII workflow diagrams.
- Added Security and IANA considerations.
- Added Relationship to Existing RFCs (RFC 4511 and RFC 3829).
- Added Change Log appendix.
]]></artwork>
    </section>
  </back>
</rfc>
