There are two typical mechanisms to register an account on an XMPP server:
The IBR mechanism is much more convenient for users, but also opens up the server to abuse, e.g. due to the mass-registration of spam bot accounts. Captchas, while heavily impacting well-intentioned users, are not a reliable mechanism to prevent abuse. This specification allows to restrict the IBR mechanism by requiring a registration token, e.g. for giving users access to a private server, without exposing their password to the server administrator.
This specification is part of a series of documents aiming at improving user onboarding:
While this specification is designed to work together with Easy User Onboarding (XEP-0401) , it can be used with invitation tokens obtained by any other mechanism. XMPP URIs can then be used out-of-band to deliver the invitation to a new user.
A client that obtains such an XMPP URI should allow the user to register an XMPP account with the server that generated the URI.
A client that implements this specification needs to understand the
XMPP URI Query Components (XEP-0147)  specification, to make use of the
action and the
preauth parameter. Three URI formats
An invitation to register an account can contain a specific XMPP address (with a pre-defined user account name) to be registered. A client should populate the address field in the IBR dialog with this address and disallow changing the address.
An invitation to register an account can contain just the server domain to register on. A client should populate the address field in the IBR dialog with this domain and allow entering the desired account name.
A contact invitation with a registration token (Pre-Authenticated Roster Subscription (XEP-0379) ) might
indicate that the token can also be used to register an account on that
ibr=y). If the receiving client already has an account
configured, it may skip account registration and simply add the contact
as defined in XEP-0379. The client may also register a new
account on the domain of the proposed contact, allowing the user to
enter the desired account name.
While a registration URI is an indication that the respective server supports Pre-Authenticated IBR, a URI might be manipulated and is not guaranteed to be reliable.
Therefore, when performing the account creation, the client needs to ensure that the server supports the Pre-Authenticated IBR protocol, as denoted by the <register xmlns='urn:xmpp:ibr-token:0'> stream feature:
In order to allow invited users to register on a server, the registration processs as defined in In-Band Registration (XEP-0077)  needs to be extended. The invited user's client needs to connect to the server and check that the invitation stream feature (<register xmlns='urn:xmpp:ibr-token:0'>) is present. After that, the client initiates the registration flow by sending the preauth token to the server:
Upon receiving the preauth request, the server must validate that the token is acceptable for account registration. However, single-use tokens MUST NOT be considered used until the actual registration has succeeded.
In addition, if the token has an expiration time, it MUST only be checked at this point. Subsequent actions performed by the client during the current session that require a valid token MUST NOT be rejected due to token expiry.
If the token is acceptable, the server responds with success, and indicates the client may now proceed with account registration:
If the token provided by the client was unknown, invalid or expired, the server should return an appropriate error to the client:
In the success case, the client proceeds with registration as defined in In-Band Registration (XEP-0077) . If the token is rejected by the server, the client still MAY attempt to perform IBR if the server allows that.
If a username was specified when creating an invitation token, the server SHOULD NOT create an account on the server until the invitee actually registers it with the corresponding token. The server MUST reserve the username at least until the corresponding token expires.
If the invitee opens an invitation URI with ibr=y and chooses to create a new account, the client SHOULD pre-fill the inviter JID's domain part as the new account's domain. The client MAY provide a mechanism to enter or choose a different server, though.
See security considerations in Pre-Authenticated Roster Subscription (XEP-0379) .
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) .
This document only makes use of the XMPP URI elements defined in Easy User Onboarding (XEP-0401) 
REQUIRED for protocol specifications.
This document in other formats: XML PDF
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.
## 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.
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".
5. 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/