<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version  (Ruby 3.2.3) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-bucksch-sasl-passkey-00" category="info" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.26.0 -->
  <front>
    <title abbrev="sasl-passkey">SASL Passkey</title>
    <seriesInfo name="Internet-Draft" value="draft-bucksch-sasl-passkey-00"/>
    <author fullname="Ben Bucksch">
      <organization>Beonex</organization>
      <address>
        <email>ben.bucksch@beonex.com</email>
      </address>
    </author>
    <author fullname="Stephen Farrell">
      <organization>Trinity College Dublin</organization>
      <address>
        <email>stephen.farrell@cs.tcd.ie</email>
      </address>
    </author>
    <date year="2025" month="January" day="31"/>
    <area>AREA</area>
    <workgroup>kitten</workgroup>
    <keyword>sasl</keyword>
    <keyword>passkey</keyword>
    <keyword>login</keyword>
    <keyword>authentication</keyword>
    <abstract>
      <t>Introduces a SASL mechanism that allows the user to authenticate using a FIDO2 Passkey.</t>
    </abstract>
    <note removeInRFC="true">
      <name>About This Document</name>
      <t>
        The latest revision of this draft can be found at <eref target="https://example.com/LATEST"/>.
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-bucksch-sasl-passkey/"/>.
      </t>
      <t>
        Discussion of this document takes place on the
        kitten Working Group mailing list (<eref target="mailto:kitten@ietf.org"/>),
        which is archived at <eref target="https://mailarchive.ietf.org/arch/browse/kitten/"/>.
        Subscribe at <eref target="https://www.ietf.org/mailman/listinfo/kitten/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://github.com/benbucksch/sasl-passkey"/>.</t>
    </note>
  </front>
  <middle>
    <section anchor="introduction">
      <name>Introduction</name>
      <t>Introduces a SASL mechanism that allows the user to authenticate using a FIDO2 Passkey.</t>
      <t>The client/server exchange is a simple challenge-response mechanism,
using the same mechanism that browsers use when they authenticate
using Passkeys to a website.</t>
    </section>
    <section anchor="creation-of-the-passkey">
      <name>Creation of the Passkey</name>
      <t>The Passkey has to be created on the user's device via other means.
Signup and passkey creation happens, for example, at the normal
web frontend of the site.</t>
      <t>We assume that the browser will use the same authenticator (OS functions) as the authenticating application. The authenticator
is responsible for creating and storing the Passkey. The
authenticator may also sync the Passkey between the user's devices.
The Passkey is never seen by either browser nor the authenticating
application, but managed entirely by the Passkey manager.</t>
      <section anchor="initial-auth-using-passkey">
        <name>Initial Auth using Passkey</name>
        <ol spacing="normal" type="1"><li>
            <t>The authenticating application has the target server hostname and
authentication identity (e.g. username or email address) configured.  If the
target server is an IMAP server, the username is the email address. If the
target server is an XMPP server, the username is the XMPP address of the user.</t>
          </li>
          <li>
            <t>The authenticating application opens (or reuses existing) connection to the
target server and starts authentication using the SASL <tt>PASSKEY</tt> mechanism.
<tt>PASSKEY</tt> mechanism starts with the client sending the initial client response,
which has the following format defined using ABNF:</t>
          </li>
        </ol>
        <sourcecode type="abnf"><![CDATA[
passkey-client-step1 = authentication_id
authentication_id    = 1*OCTET
]]></sourcecode>
        <t>3.
  a. The server generates a Passkey challenge, based on the
  target server hostname, authentication identity, and Passkey of the user,
  and sends the server challenge with to the client.</t>
        <t>b. If login for that user is forbidden, the server will return a
  SASL error. A human-readable error message for end users
  must be included, with a detailed and helpful description of why
  login is forbidden for that user, and instructions for the user
  how the situation can be remedied.</t>
        <t>4.
The authenticating application takes the challenge and passes it
on as-is to the OS authenticator API, which returns the response.
The OS calls are the same that the web browser would do.</t>
        <t>As part of this process, the OS authenticator API may require
the end user to complete additional authentication, for example
entering a device unlock code, providing a fingerprint,
face recognition, or similar. This is the responsibility of the
OS authenticator and outside the scope of this protocol.</t>
        <t>The authenticating application then passes on the response
as-is to the server.</t>
        <t>5.
  a. If the server accepts the response as valid and allows login,
  it responds with a SASL success response. The user is logged in.</t>
        <t>b. If the response is invalid, the server responds with a
  SASL error and a human-readable error message for the end user.</t>
        <sourcecode type="abnf"><![CDATA[
server-final-message = server-error "," server-error-message
        ; Only returned on error. Omitted on success.

server-error = "e=" server-error-value

server-error-value = "invalid-encoding" /
                     "unknown-user" /
                     "invalid-username-encoding" /
                       ; invalid username encoding (invalid UTF-8 or
                       ; SASLprep failed)
                     "other-error" /
                     server-error-value-ext
        ; Unrecognized errors should be treated as "other-error".
        ; In order to prevent information disclosure, the server
        ; may substitute the real reason with "other-error".

server-error-value-ext = value
        ; Additional error reasons added by extensions
        ; to this document.

server-error-message = "m=" server-error-message-value

server-error-message-value = 1*OCTET
        ; Human readable error message in UTF-8
]]></sourcecode>
        <t>This SASL mechanims will typically be combined with SASL chain
or SASL2, to allow re-opening a new connection without requiring
the user to go through Passkey authentication again.</t>
      </section>
    </section>
    <section anchor="imap-example">
      <name>IMAP Example</name>
      <t>In IMAP, the exchange would be:</t>
      <artwork><![CDATA[
S: * OK ACME IMAP Server v1.23 is ready
C: 22 CAPABILITY
S: 22 CAPABILITY IMAP4rev1 IMAP4rev2 AUTH=PASSKEY AUTH=REMEMBERME
C: 23 AUTHENTICATE PASSKEY eW91QGV4YW1wbGUuY29tCg==
S: AEC6576576557=== (passkey challenge)
C: EAB675757GJvYgB== (passkey response)
S: 23 OK AUTHENTICATE completed
]]></artwork>
      <t>Where "eW91QGV4YW1wbGUuY29tCg==" is base64-encoded authentication identity
("you@example.com"), "AEC6576576557===" is base64-encoded passkey challenge,
"EAB675757GJvYgB==" is base64-encoded passkey response.  All challenge and
responses values are base64-encoded according to the IMAP SASL protocol
profile.</t>
    </section>
    <section anchor="conventions-and-definitions">
      <name>Conventions and Definitions</name>
      <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>It's all about security.</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>IANA is requested to add the following entry to the SASL Mechanism registry
established by <xref target="RFC4422"/>:</t>
      <artwork><![CDATA[
To: iana@iana.org
Subject: Registration of a new SASL mechanism PASSKEY

SASL mechanism name (or prefix for the family): PASSKEY
Security considerations: Section YY of [RFCXXXX]
Published specification (optional, recommended): [RFCXXXX]
Person & email address to contact for further information:
    IETF Kitten WG <kitten@ietf.org>
Intended usage: COMMON
Owner/Change controller: IESG <iesg@ietf.org>
Note:
]]></artwork>
    </section>
  </middle>
  <back>
    <references>
      <name>Normative References</name>
      <reference anchor="RFC2119">
        <front>
          <title>Key words for use in RFCs to Indicate Requirement Levels</title>
          <author fullname="S. Bradner" initials="S." surname="Bradner"/>
          <date month="March" year="1997"/>
          <abstract>
            <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="2119"/>
        <seriesInfo name="DOI" value="10.17487/RFC2119"/>
      </reference>
      <reference anchor="RFC8174">
        <front>
          <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
          <author fullname="B. Leiba" initials="B." surname="Leiba"/>
          <date month="May" year="2017"/>
          <abstract>
            <t>RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="8174"/>
        <seriesInfo name="DOI" value="10.17487/RFC8174"/>
      </reference>
      <reference anchor="RFC4422">
        <front>
          <title>Simple Authentication and Security Layer (SASL)</title>
          <author fullname="A. Melnikov" initials="A." role="editor" surname="Melnikov"/>
          <author fullname="K. Zeilenga" initials="K." role="editor" surname="Zeilenga"/>
          <date month="June" year="2006"/>
          <abstract>
            <t>The Simple Authentication and Security Layer (SASL) is a framework for providing authentication and data security services in connection-oriented protocols via replaceable mechanisms. It provides a structured interface between protocols and mechanisms. The resulting framework allows new protocols to reuse existing mechanisms and allows old protocols to make use of new mechanisms. The framework also provides a protocol for securing subsequent protocol exchanges within a data security layer.</t>
            <t>This document describes how a SASL mechanism is structured, describes how protocols include support for SASL, and defines the protocol for carrying a data security layer over a connection. In addition, this document defines one SASL mechanism, the EXTERNAL mechanism.</t>
            <t>This document obsoletes RFC 2222. [STANDARDS-TRACK]</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="4422"/>
        <seriesInfo name="DOI" value="10.17487/RFC4422"/>
      </reference>
    </references>
    <section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>TODO acknowledge.</t>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA7VZ4XIbtxH+j6dA6ZlGzpBUJMtxwkYZnyTKZiOJikjV0WQy
DXgHkqiOOAbAiWYy7rP0Wfpk/RbAkXeU5Pyq7JGOOGB3sfvttwuw0+mwFy9e
sBd8oJ00WrrOmRFTxy+Fuc+KleZjuVjmwknmlMtlj7dGyeiCXwtr7+W6xcRk
YuQDhq2weWdZDadYMSvMuseVnhaMZUWqxQLLM5LemZTpvU3nnfqizldfMVtO
FspaVWi3XmL2oD8+5/wFF7ktoEPpTC4lfmnXavOWzJQrjBI5fRgkJ/hTGDzd
jM9bTJeLiTQ9l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