<?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-ietf-kitten-sasl-rememberme-00" category="info" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.27.0 -->
  <front>
    <title abbrev="sasl-rememberme">SASL Remember Me</title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-kitten-sasl-rememberme-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="February" day="28"/>
    <area>AREA</area>
    <workgroup>kitten</workgroup>
    <keyword>sasl</keyword>
    <keyword>rememberme</keyword>
    <keyword>login</keyword>
    <keyword>authentication</keyword>
    <abstract>
      <t>Introduces a SASL mechanism that allows the application to stay
logged in and re-login without user interaction, after completing a
time-consuming SASL login mechanism that involves the user.</t>
    </abstract>
    <note removeInRFC="true">
      <name>About This Document</name>
      <t>
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-ietf-kitten-sasl-rememberme/"/>.
      </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-rememberme"/>.</t>
    </note>
  </front>
  <middle>
    <section anchor="introduction">
      <name>Introduction</name>
      <t>A client application might at first log in to a server using
Passkey or multi-factor authentication. However, these mechanisms
require complicated user interaction. These are too costly to
perform at every login. They can realistically only be
completed once during setup. To stay logged in, this SASL
mechanism allows the server to create a client-specific token that
the client application can then use to log in to the same account,
without further user interaction.</t>
      <t>The token is opaque to the client and the server can choose how to
implement it. It may be a custom random string that the server
stores, or an application-specific password generated for this
client together with the username, or a JWT token, or a
refresh token which does not expire.</t>
    </section>
    <section anchor="creation-of-the-token">
      <name>Creation of the token</name>
      <t>The client requests the token from the server using either
1. application-specific commands, like IMAP <tt>REMEMBERME</tt>,
which are to be defined in other standards.
2. the success response of another SASL mechanism.</t>
      <t>The client stores the token, instead of a password,
in a client-specific storage that is as secure as a password
storage.</t>
    </section>
    <section anchor="login-using-the-token">
      <name>Login using the token</name>
      <t>If the client needs to log in and has a token for this user and host, uses
the SASL <tt>REMEMBERME</tt> mechanism to log in.  <tt>REMEMBERME</tt> mechanism starts
with the client sending the initial client response, which has the following
format defined using ABNF:</t>
      <sourcecode type="abnf"><![CDATA[
rememberme-client-step1 = token
token                   = 1*OCTET
]]></sourcecode>
      <t>If the server accepts the response as valid and allows login, it responds with
a SASL success response. The user is logged in.  (ALTERNATIVE EXPIRY: ....  it
responds with a SASL success response, a new token, and the expiry time of the
new token. The user is logged in.  To avoid race conditions in clients that
open multiple connections at the same time, the previously used token <bcp14>MUST</bcp14> be
valid for at least 30 more seconds. Likewise, if the server returned a new
token, then it must return the same new token in response to the same old token
for the next 1 hour.  Reason: If the client opens 5 connections at the same
time, using the same token, but the server were to respond with 5 different new
tokens, and it were to allow only 1 of them, then the client would not know
which one to store, due to race conditions in the network response.)</t>
      <t>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>
    </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 REMEMBERME QUVDNjU3NjU3NjU1Nwo=
S: 23 OK AUTHENTICATE completed
]]></artwork>
      <t>In the above example the token is "AEC6576576557" which is base64-encoded
according to IMAP SASL profile.</t>
    </section>
    <section anchor="requirements-on-the-token">
      <name>Requirements on the token</name>
      <ol spacing="normal" type="1"><li>
          <t>The token <bcp14>MUST</bcp14> also allow the server to infer the authentication identity (e.g. username or email address).
The token alone must be sufficient to log in.
This SASL mechanism doesn't support separate authorization identities.</t>
        </li>
        <li>
          <t>The token <bcp14>MUST NOT</bcp14> expire.
(ALTERNATIVE EXPIRY: The token <bcp14>MUST</bcp14> be valid for at least 30 days.)</t>
        </li>
        <li>
          <t>The server <bcp14>SHOULD</bcp14> be able to revoke the tokens,
in case this specific user account or device was compromised.
In this case, the authentication <bcp14>MUST</bcp14> fail and the SASL error message
<bcp14>MUST</bcp14> explain the situation to the user and give instructions
how to remedy the situation.</t>
        </li>
      </ol>
    </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>Clients should treat the token like a password and store it securely.</t>
      <t>TODO Security</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>IANA is requested to add the following entries to the SASL Mechanism registry
established by <xref target="RFC4422"/>:</t>
      <artwork><![CDATA[
To: iana@iana.org
Subject: Registration of a new SASL mechanism REMEMBERME

SASL mechanism name (or prefix for the family): REMEMBERME
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:
H4sIAAAAAAAAA4VZ63IbtxX+j6dAmZnWzpBUKMlxykYZUxQds5FERaLiaDKZ
CbgLkoh2FwywS5rNuM/SZ+mT9TsA9kZJU40tcbHAuXznDvZ6PZarPJFD3rkb
3V3yW5nKdCENv5IdJhYLI7d4ZYVNeia8SvEmErlcabMfcpUtNWOxjjKRgkps
xDLvKZkve48qz2XWOzjb++orZotFqqxVOsv3GxyaTubvOf+Ci8RqcFNZLDcS
v7K80+UdGatcGyUSepiOzvFHG3y6nb/vsKwgskMWQ6Ahi3RmZWYLO+S5KSSD
7CdMGCmGfHQ7GbGdNo8ro4vNkHvp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