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.
A typical client might use this protocol alongside that of TOTP, Extensible SASL Profile (XEP-0388) , 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.
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 (<firstname.lastname@example.org> 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.
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.
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.
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.
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.
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.
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.
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.
This document in other formats: XML PDF
This XMPP Extension Protocol is copyright © 1999 – 2019 by the XMPP Standards Foundation (XSF).
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.
## 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. ##
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.
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).
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.
There exists a special venue for discussion related to the technology described in this document: the <email@example.com> mailing list.
The primary venue for discussion of XMPP Extension Protocols is the <firstname.lastname@example.org> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.
Errata can be sent to <email@example.com>.
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".
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/