XEP-0389: Extensible In-Band Registration

This specification defines an XMPP protocol extension for in-band registration with instant messaging servers and other services with which an XMPP entity may initiate a stream. It aims to improve upon the state of the art and replace XEP-0077: In-Band Registration by allowing multi-factor registration mechanisms, and account recovery.
Sam Whited
© 1999 – 2020 XMPP Standards Foundation. SEE LEGAL NOTICES.


WARNING: This Standards-Track document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems are advised to carefully consider whether it is appropriate to deploy implementations of this protocol before it advances to a status of Draft.
Standards Track
0.3.0 (2020-04-19)
Document Lifecycle
  1. Experimental
  2. Proposed
  3. Draft
  4. Final

1. Introduction

Historically, registering with an XMPP service has been difficult. Each server either used customized out-of-band registration mechanisms such as web forms which were difficult to discover, or they used In-Band Registration (XEP-0077) [1] which could easily be abused by spammers to register large numbers of accounts and which allowed for only limited extensibility.

To solve these issues this specification provides a new in-band registration protocol that allows servers to present the user with a series of "challenges". This allows for both multi-stage proof-of-posession registration flows and spam prevention mechanisms such as proof-of-work functions.

2. Requirements

3. Use Cases

4. Discovering Support

4.1 Stream Feature

If a server supports registering for or recovering an account using Extensible IBR, it MUST inform the connecting client when returning stream features during the stream negotiation process. This is done by including a <register/> element, qualified by the 'urn:xmpp:register:0' namespace for account registration, or a <recovery/> element qualified by the same namespace for account recovery. The register and recovery features are always voluntary-to-negotiate. The registration and recovery features MUST NOT be advertised before encryption has been negotiated, eg. using direct TLS or opportunistic TLS. They SHOULD be advertised at the same time as the SASL authentication feature, meaning that after registration or recovery is completed SASL authentication can proceed.

For recovery or registration, the server MUST include a list of all challenge types which the client may receive during the course of registering or recovering an account. These are grouped into "flows" and let the client pick a registration workflow that only contains challenges which the client supports. Each <flow/> element MUST have a unique "id" attribute which is used by the client to identify the flow being selected. They must also have at least one <name/> element containing a short, human readable description of the flow. If multiple <name/> elements are present they MUST have unique values for the "xml:lang" attribute. Clients MAY use the name element to show the different flows to the user and ask them to pick between them. Each flow must also contain a list of <challenge/> elements representing the various challenges that must be completed to complete the registration or recovery flow. Each <challenge/> element contains a string that uniquely (within the given parent element) identifies the type of challenge that will be offered. If a flow would offer the same challenge twice (eg. two dataforms asking for different data), the challenge SHOULD only be listed once in the flow element.

For example, a server may advertise a "Verify with SMS" flow and a "Verify by Phone Call" flow that both show a dataform asking for a phone number and then a second dataform asking for a token provided to the user in a text message or phone call depending on which flow the user selects.

Example 1. Host Advertises Stream Features
  <mechanisms xmlns='urn:xmpp:sasl:0'>
  <register xmlns='urn:xmpp:register:0'>
    <flow id="0">
      <name>Verify with SMS</name>
    <flow id="1">
      <name>Verify by Phone Call</name>
    <flow id="2">
      <name>Verify with the web</name>
  <recovery xmlns='urn:xmpp:register:0'>
    <flow id="0">
      <name>Visit Password Recovery Site</name>

4.2 Service Discovery

Clients, servers, and other services such as components that support Extensible IBR after stream negotiation is complete MUST advertise the fact by including a feature of "urn::xmpp:register:0" in response to Service Discovery (XEP-0030) [2] information requests and in their Entity Capabilities (XEP-0115) [3] profiles.

Example 2. Disco response
<feature var='urn:xmpp:register:0' />

5. Challenges

A client selects the registration or recovery feature for negotiation by replying with an element of the same name and namespace. The element MUST contain a <flow> element that MUST have an "id" attribute matching one of the flows advertised by the server. For example, to select the "Verify by Phone Call" registration flow from the previous example, the client would reply with:

Example 3. Client selects a recovery flow
<register xmlns='urn:xmpp:register:0'>
  <flow id="1"/>

If the client is initiating registration or recovery after a stream has already been initiated it uses the same registration element wrapped in an IQ of type "set".

Example 4. Client selects a recovery flow after stream negotiation
<iq type="set" id="foo">
  <recovery xmlns='urn:xmpp:register:0'>
    <flow id="0"/>

The server then replies to the IQ or feature selection with a challenge. If replying to an IQ, the challenge must be wrapped in an IQ of type "result". Challenges take the form of a <challenge/> element qualified by the 'urn:xmpp:register:0' namespace with a 'type' attribute containing the challenge type and containing a challenge data payload.

Type type of a challenge is a value which identifes what sort of payload a client might expect. This document defines a type of 'jabber:x:data' which MUST always contain a data form (an 'x' element with type 'form') as defined by Data Forms (XEP-0004) [4]. Other types may be defined in the future. For example, a challenge containing a data form might look like the following:

Example 5. Host Returns Registration Form to Entity
<challenge xmlns='urn:xmpp:register:0'
  <x xmlns='jabber:x:data' type='form'>
    <title>Chat Registration</title>
      Please provide the following information
      to sign up to view our chat rooms!
    <field type='hidden' var='FORM_TYPE'>
    <field type='text-single' label='Given Name' var='first'/>
    <field type='text-single' label='Family Name' var='last'/>
    <field type='text-single' label='Nickname' var='nick'>
    <field type='text-single' label='Recovery Email Address' var='email'>

After a challenge is received, the client replies to the challenge by sending a <response/> element qualified by the 'urn:xmpp:register:0' namespace or a cancelation as defined later in this document. If the client sends a response, it MUST also include a payload defined by the specific challenge type. In the case of a jabber:x:data challenge, the payload should be a form submission as defined by Data Forms (XEP-0004) [4] (an 'x' element of type 'submit'). For instance, to reply to the data form challenge from the previous example a client might send:

Example 6. User Submits Registration Form
<response xmlns='urn:xmpp:register:0'>
  <x xmlns='jabber:x:data' type='submit'>
    <field type='hidden' var='FORM_TYPE'>
    <field type='text-single' label='Given Name' var='first'>
    <field type='text-single' label='Family Name' var='last'>
    <field type='text-single' label='Nickname' var='nick'>
    <field type='text-single' label='Recovery Email Address' var='email'>

6. Completing Registration or Recovery

If after receiving a challenge or response a client or server does not wish to continue registration or recovery, it may send an empty <cancel/> element qualified by the 'urn:xmpp:register:0' namespace. This informs the client or server that registration is complete. This is the same as submitting a data form of type 'cancel' in response to a data form challenge.

Example 7. User Cancels Registration or Recovery
<cancel xmlns='urn:xmpp:register:0'/>

If the IQ based registration or recovery flow is being used and the server wishes to cancel the flow, it MAY respond to any IQ from the client with the cancel element and type "result".

Example 8. Server cancels rquest
<iq type="result" id="bar">
  <cancel xmlns='urn:xmpp:register:0'/>

If the client successfully completes all required challenges during stream negotiation the server MUST return an empty <success/> element qualified by the 'urn:xmpp:register:0' namespace, at which point it may continue with the stream negotiation process. If the server needs more information, for example, in the previous challenge the user entered an email and now the server wishes to ask for a code that was sent to that email, the server MAY send another challenge.

Example 9. Server indicates success during steam negotiation
<success xmlns='urn:xmpp:register:0'/>

If the IQ based flow is being used and the server wishes to indicate success it sends an empty IQ response of type "result".

Example 10. Server indicates success after stream negotation
<iq type="result" id="bar" />

7. Internationalization Considerations

When providing instructions in a data form, or in the name element of a registration or recovery flow, the server SHOULD use the language specified in the XML stream's current xml:lang, or the closest language for which the server has a translation (eg. based on mutual intelligibility between scripts and languages).

For more information about language tags and matching, see BCP 47 [5].

8. Security Considerations

Servers that allow in-band registration need to take measures to prevent abuse. Common techniques to prevent spam registrations include displaying CAPTCHAs or requiring proof-of-posession of a valid email address or telephone number by sending a unique code (e.g. an HMAC that can later be verified as having originated at the server) to the users email and requiring that they enter the code before continuing. Servers that do not take such measures risk being black listed by other servers in the network.

9. IANA Considerations

This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [6].

10. XMPP Registrar Considerations

10.1 Protocol Namespaces

This specification defines the following XML namespace:

Upon advancement of this specification from a status of Experimental to a status of Draft, the XMPP Registrar [7] shall add the foregoing namespace to the registry located at <https://xmpp.org/registrar/stream-features.html>, as described in Section 4 of XMPP Registrar Function (XEP-0053) [8].

10.2 IBR Challenge Types Registry

The XMPP Registrar shall maintain a registry of IBR challenge types. Challenge types defined within the XEP series MUST be registered with the XMPP Registrar.

In order to submit new values to this registry, the registrant shall define an XML fragment of the following form and either include it in the relevant XMPP Extension Protocol or send it to the email address <registrar@xmpp.org>:

  <name>The name of the challenge type.</name>
  <desc>A natural-language summary of the challenge.</desc>
    The document in which the IBR challenge payload is specified.
    The doucment in which the IBR challenge itself is specified (may be the same
    as <payloaddoc/>).

For an example registration, see the next section.

10.3 Challenge Types

This specification defines the following IBR challenge types:

Upon advancement of this specification from a status of Experimental to a status of Draft, the XMPP Registrar [7] shall add the following definition to the IBR challenge types registry, as described in this document:

  <name>Data Forms Challenge</name>
  <desc>Requests that the client fill out an XEP-0004 data form.</desc>
  <doc>TODO: Insert this document once it is assigned a number</doc>

10.4 Namespace Versioning

If the protocol defined in this specification undergoes a revision that is not fully backwards-compatible with an older version, the XMPP Registrar shall increment the protocol version number found at the end of the XML namespaces defined herein, as described in Section 4 of XEP-0053.


Appendix A: Document Information

XMPP Standards Foundation
Standards Track
Last Updated
Approving Body
XMPP Council
Superseded By
Short Name
Source Control

This document in other formats: XML  PDF

Appendix B: Author Information

Sam Whited


This XMPP Extension Protocol is copyright © 1999 – 2020 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.

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

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 <http://xmpp.org/about/discuss.shtml> 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-0077: In-Band Registration <https://xmpp.org/extensions/xep-0077.html>.

2. XEP-0030: Service Discovery <https://xmpp.org/extensions/xep-0030.html>.

3. XEP-0115: Entity Capabilities <https://xmpp.org/extensions/xep-0115.html>.

4. XEP-0004: Data Forms <https://xmpp.org/extensions/xep-0004.html>.

5. BCP 47: Tags for Identifying Languages <http://tools.ietf.org/html/bcp47>.

6. 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/>.

7. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <https://xmpp.org/registrar/>.

8. XEP-0053: XMPP Registrar Function <https://xmpp.org/extensions/xep-0053.html>.

Appendix H: Revision History

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

  1. Version 0.3.0 (2020-04-19)
  2. Version 0.2.0 (2018-10-01)
    Defer due to lack of activity.
    XEP Editor (jsc)
  3. Version 0.1.0 (2017-03-16)
    Move to experimental.
    XEP Editor (ssw)
  4. Version 0.0.2 (2017-02-15)
  5. Version 0.0.1 (2017-02-08)

    First draft.