This document offers mechanisms to solve the following problem: There are two XMPP client entities (Verifier and Prover). The Verifier can be presenting e.g., a physical device, an application or a service and and the Prover is presenting an XMPP account of user entity (e.g., a human) that wants to login. Before the Verifier can execute or ask executing any access control mechanism, e.g., to check if the Prover's XMPP accout is authorized use certain resource(s), the Prover must be authenticated. We present usage of two-factor authentication in which the following authentication factors are used:
In addition to these, described mechanism offers possibility to approve authentication inside only a certain time-slot.
Prover and Verifier entities mean same as in RFC 6238  but are implemented as two XMPP clients. When using terms of Remote Controlling Clients (XEP-0146) , Prover is Local Client and Verifier is Remote Client.
Several mechanisms for client-to-client authentication, such as C2C Authentication Using TLS (XEP-0250)  exist and can be used with the protocol defined in this document. This document describes a new simple and extendable protocol for two-factor one-way client authentication by specifying a profile on Ad-Hoc Commands (XEP-0050) . One-way here means that the actual user (e.g, a human) of Prover's XMPP Client is not required to know anything about the Verifier.
This document addresses the following requirements:
A client MAY advertise any authentication commands it supports via Service Discovery (XEP-0030)  (as described in XEP-0050).
If these commands are advertised, Entity Capabilities (XEP-0115)  can be used to query capability of authentication commands in a client. If the Prover and the Verifier are working on a same physical device, they both MAY know the exact format and existence of supported commands.
The following table lists common terms and corresponding descriptions.
This document defines a profile of XEP-0050 that enables a client to perform the following tasks on a entity that or which resources it wants to use:
Although this document aims to define common use cases for authentication, an implementation or deployment MAY support any subset and MAY support additional commands not defined herein.
Note: The text that follows assumes that implementors have read and understood Ad-Hoc Commands (XEP-0050) , password generation algorithms described in RFC 4226  and RFC 6238 , and randomness requirements described in RFC 4086 , and know about one-time pads and perfect secrecy.
Time-Based One-Time Password (TOTP) algorithm described in RFC 6238  is an extension of the HMAC-based One-Time Password (HOTP) algorithm defined in RFC 4226 , to support the time-based moving factor. In TOTP, time reference and a time step replaces the counter in the HOTP computation.
Unless an error occurs (see the Error Handling section below), the service SHOULD return the appropriate form.
After receiving a correct secret, the Verifier informs Prover of completion.
As described in RFC 4949  one-time pad is an encryption algorithm in which the key is a random sequence of symbols and each symbol is used for encryption only one time, i.e., used to encrypt only one plaintext symbol and thus produce only one ciphertext symbol and thus produce only one ciphertext symbol. A copy of the key is used similarly for decryption.
Unless an error occurs (see the Error Handling section below), the service SHOULD return the appropriate form.
After receiving a one-time pad, the Verifier informs Prover of completion.
Several error conditions are possible when a Prover sends a command request to the Verifier, as defined in the following table. If one of these errors occurs, the Verifier entity MUST return an error stanza to the requesting Prover.
|<feature-not-implemented/>||The specific command is not supported (even though the ad-hoc commands protocol is).|
|<forbidden/>||The requesting entity does not have sufficient privileges to perform the command.|
|<service-unavailable/>||The ad-hoc commands protocol is not supported.|
|<payment-required/>||If the user needs to provide payment in order to access to resources behind the Verifier (e.g., if the user is not in the customer database or the customer's account is not paid up).|
For the syntax of these errors, see Error Condition Mappings (XEP-0086) . Naturally, other errors may be returned as well.
Implementations of this protocol MAY introduce extra forms for commands and MAY use other secret key generation mechanisms than currently presented TOTP and one-time pad.
There are several secure ways to transmit one-time pads or the shared secret that is used in TOTP from Verifier to the Prover. If both Verifier and Prover entities are running in one application inside one device, the shared secret can be generated and transmitted inside running implementation and be removed right after the usage.
Presented authentication mechanism offers possibilities to execute at least the following access policies and different combinations of them, but their detailed descriptions and how policies are transmitted to the Verifier are out of scope of this document:
In each case, the Verifier MAY check Prover's JID right after receiving the first Ad-Hoc command or after a succesful verification process.
If Prover's JID is not approved, the Verifier SHOULD reply with <forbidden/> error message.
After the a succesful verification the Verifier can, e.g.,
Mechanisms for determining when a command can be executed based on permissions or rights are considered specific to the application and/or implementation of XEP-0050, as defined in XEP-0050. In this application a command SHOULD be executed if and only if it comes from full user's JID that is already known to the Verifier. This decreases possibility to execute, e.g, relay attacks. Determining other permissions or rights are considered specific to access policies of systems, as presented in Business Rules section.
Possibility of executing Denial-of-service (DoS) attacks against the Verifier can be reduced by ending processing of received messages coming from not authorized JIDs or containing incorrect secret as early as possible.
Randomness requirements for security described in RFC 4086 apply.
When using TOTP, security considerations of RFC 6238 apply.
When using TOTP, HMAC-SHA-256 or HMAC-SHA-512 functions SHOULD be used instead of the HMAC-SHA-1 that has been specified for the HOTP computation in RFC 4226.
When using TOTP, when an OTP is generated at the end of a time-step window, the receiving time most likely falls into the next time-step window. A validation system MUST set a policy for an acceptable OTP transmission delay window for validation. A larger acceptable delay window would expose a larger window for attacks, so as in RFC 6238, we RECOMMEND that at most one time step is allowed as the network delay.
As described in Introduction, the user of the Prover XMPP client does not necessarily know anything about the Verifier. In addition to this, the user does not necessarily know what the device or the application will do after a succesful authentication. Notice that this problem relates to every closed source XMPP client implementations, thus implementations' code SHOULD be open source.
When using one-time pads, to ensure one-time use, the copy of the key used for encryption MUST be destroyed after use, as is the copy used for decryption.
When using one-time pads, commands containing pads that have incorrect pad length, SHOULD not be executed.
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) .
The XMPP Registrar includes 'http://jabber.org/protocol/auth' in its registry of protocol namespaces (see <https://xmpp.org/registrar/namespaces.html>).
Field Standardization for Data Forms (XEP-0068)  defines a process for standardizing the fields used within Data Forms scoped by a particular namespace (see also <https://xmpp.org/registrar/formtypes.html>). The reserved fields for the 'http://jabber.org/protocol/auth' namespace are specified below.
Because the protocol defined here is a profile of XEP-0050, no schema definition is needed.
This document in other formats: XML PDF
This XMPP Extension Protocol is copyright (c) 1999 - 2013 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 shall the XMPP Standards Foundation or the authors of this Specification be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification. ##
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 out of the use or inability to use 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 may be found at <http://www.xmpp.org/extensions/ipr-policy.shtml> or obtained by writing to XSF, P.O. Box 1641, Denver, CO 80201 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.
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".
13. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/