XEP-0399: Client Key Support

Abstract
This specification defines an XMPP binding of the supporting functions for the CLIENT-KEY SASL mechanism.
Author
Dave Cridland
Copyright
© 2018 – 2018 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status

Deferred

WARNING: This document has been automatically Deferred after 12 months of inactivity in its previous Experimental state. Implementation of the protocol described herein is not recommended for production systems. However, exploratory implementations are encouraged to resume the standards process.
Type
Standards Track
Version
0.1.0 (2018-01-25)
Document Lifecycle
  1. Experimental
  2. Deferred
  3. Proposed
  4. Stable
  5. Final

1. Introduction

The CLIENT-KEY SASL mechanism defined in draft-cridland-kitten-clientkey-00.txt suggests supporting protocol messages to be present in the application protocol. This specification defines these for XMPP.

2. Typical Flow

A typical client might use this protocol alongside that of TOTP, Extensible SASL Profile (XEP-0388) [1], and draft-cridland-kitten-clientkey-00.txt as follows.

On first use, a client will use a traditional SASL mechanism using SASL2, such as SCRAM. The server will then prompt using <next-authenticate/> to initiate, or perform, TOTP.

The client will then request a Client Key to reauthenticate later. This may be one or both of a short-term Client Key intended for in-memory storage, perhaps for use with ISR, and a longer-term Client Key used for a "remember this client" to suppress 2FA for a period.

Later authentications will use CLIENT-KEY or CLIENT-KEY-PLUS, and the server SHOULD suppress TOTP in such cases.

3. Client Key Support Operations

3.1 Client Registration

Client registration requests a Client Key from the server. It is typically used to speed reauthentication during a session, and to elide a full reauthentication at the start of a subsequent session.

In order to register and obtain a Client Key, a client sends an <iq/> of type "set" containing an XML representation of the data required, within a <register/> element qualified by the 'urn:xmpp:client-key:0' namespace, containing four elements in any order. Descriptions of values are here informative; the canonical definition is in draft-cridland-kitten-clientkey-00.txt.

<id/> has a text value of the ClientID, a suitable identifier for the client instance, unique within the scope of the authenticated (<localpart@domain.tld> or <domain.tld>).

<name/> has a text value of the Client Name, a human-readable name for the client instance.

<key/> has a text value of the ValidationKey, encoded using Base 64. Implementors are strongly advised to take careful note of the requirements of the ValidationKey as discussed in draft-cridland-kitten-clientkey-00.txt.

<ttl/> has a text value containing a integer string representation of the number of seconds the Client Key is requested to last for.

In the following example, the ValidationKey is H("Random"), and the TTL is for 30 days - a reasonable "Remember this client" option.

Example 1.
<iq type='set' id='123456'>
  <register xmlns='urn:xmpp:client-key:0'>
    <id>213456-987123-123987</iq>
    <name>SuperChatBiscuit on Honest Pete's Mobile OS</name>
    <key>WNiIwIqlYfNw44zul2EhUyqIPXE=</key>
    <ttl>2592000</ttl>
  </register>
</iq>
      

The server responds with two items of information in a <registered/> element qualified by the 'urn:xmpp:client-key:0' namespace. The EncryptedSecret is contained within a <encrypted-secret/> element as a base64-encoded value, and the <expiry/> element contains a timestamp for expiry.

Example 2.
<iq type='result' id='123456'>
  <registered xmlns='urn:xmpp:client-key:0'>
    <encrypted-secret>WNiIwIqlYfNw44zul2EhUyqIPXE=</encrypted-secret>
    <expiry>2017-10-15T12:00:00Z</expiry>
  </registered>
</iq>

Note that the expiry time might not be 30 days simply because the client has requested it - the server is free to shorten expiry times.

3.2 Key Revocation

Any authenticated client may revoke a key belonging to the same user by sending an <iq/> of type "set" containing a <revoke/> element qualified by the 'urn:xmpp:client-key:0' namespace, containing a <key/> element whose text value is the ClientID corresponding to the key to be revoked.

Example 3.
<iq type='set' id='123456'>
  <revoke xmlns='urn:xmpp:client-key:0'>
    <id>213456-987123-123987</iq>
  </revoke>
</iq>
      

3.3 Key Enumeration

Any authenticated client may enumerate keys belonging to the same user by sending an <iq/> of type "get" containing a <list/> element qualified by the 'urn:xmpp:client-key:0' namespace.

Example 4.
<iq type='get' id='123456'>
  <list xmlns='urn:xmpp:client-key:0'/>
</iq>
      

The server responds with an <iq/> of type 'result', containing the <list/> element qualified by the 'urn:xmpp:client-key:0' namespace. This element contains a sequence of <key/> elements each containing (in any order) the <id/>, <name/> and <expiry/> elements as in registration.

Example 5.
<iq type='result' id='123456'>
  <list xmlns='urn:xmpp:client-key:0'>
    <key>
      <id>213456-987123-123987</iq>
      <name>SuperChatBiscuit on Honest Pete's Mobile OS</name>
      <expiry>2017-10-15T12:00:00Z</expiry>
    </key>
    <key>
      <id>313456-987123-123987</iq>
      <name>SuperChatChocolate on Honest Bob's Mobile OS</name>
      <expiry>2018-01-08T12:00:00Z</expiry>
    </key>
  </list>
</iq>
      

4. Determining Support

Support for this protocol is advertised as the Disco feature 'urn:xmpp:client-key:0'; however clients MAY infer support if the CLIENT-KEY or CLIENT-KEY-PLUS SASL mechanism is supported.

5. Security Considerations

Security considerations for this specification are covered within the Internet-Draft draft-cridland-kitten-clientkey-00.txt - this specification introduces no further considerations by design, but relies heavily on the guidance given there.


Appendices

Appendix A: Document Information

Series
XEP
Number
0399
Publisher
XMPP Standards Foundation
Status
Deferred
Type
Standards Track
Version
0.1.0
Last Updated
2018-01-25
Approving Body
XMPP Council
Dependencies
None
Supersedes
None
Superseded By
None
Short Name
client-key
Registry
<https://xmpp.org/registrar/client-key.html>
Source Control
HTML

This document in other formats: XML  PDF

Appendix B: Author Information

Dave Cridland
Email
dave@hellopando.com
JabberID
dwd@dave.cridland.net

Copyright

This XMPP Extension Protocol is copyright © 1999 – 2024 by the XMPP Standards Foundation (XSF).

Permissions

Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.

Disclaimer of Warranty

## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##

Limitation of Liability

In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.

IPR Conformance

This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).

Visual Presentation

The HTML representation (you are looking at) is maintained by the XSF. It is based on the YAML CSS Framework, which is licensed under the terms of the CC-BY-SA 2.0 license.

Appendix D: Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.

Appendix E: Discussion Venue

There exists a special venue for discussion related to the technology described in this document: the <standards@xmpp.org> mailing list.

The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.

Discussion on other xmpp.org discussion lists might also be appropriate; see <https://xmpp.org/community/> for a complete list.

Errata can be sent to <editor@xmpp.org>.

Appendix F: Requirements Conformance

The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".

Appendix G: Notes

1. XEP-0388: Extensible SASL Profile <https://xmpp.org/extensions/xep-0388.html>.

Appendix H: Revision History

Note: Older versions of this specification might be available at https://xmpp.org/extensions/attic/

  1. Version 0.1.0 (2018-01-25)
    Accepted by vote of Council on 2018-01-10.
    XEP Editor (jwi)
  2. Version 0.0.1 (2018-01-08)

    First draft

    dwd

Appendix I: Bib(La)TeX Entry

@report{cridland2018client-key,
  title = {Client Key Support},
  author = {Cridland, Dave},
  type = {XEP},
  number = {0399},
  version = {0.1.0},
  institution = {XMPP Standards Foundation},
  url = {https://xmpp.org/extensions/xep-0399.html},
  date = {2018-01-08/2018-01-25},
}

END