Romeo is an active XMPP IM (Instant Messaging) user or the operator of an XMPP server. He convinces Juliet (who may not have an XMPP account yet) to install a client but she may still need to choose an XMPP server, create an account, and add Romeo as a contact. This specification defines two ways for Romeo to simplify this process for Juliet:
If Romeo is an XMPP user, he can create an out-of-band link (URI) which allows Juliet to:
The process is designed to automatically skip steps that Juliet already completed, to make the overall experience as smooth as possible.
If Romeo is an administrator of an XMPP server, he can create an out-of-band link (URI) which allows Juliet to:
This specification makes use of XMPP URIs. The basic URI scheme for XMPP is defined in RFC 5122  and extended in XMPP URI Query Components (XEP-0147)  and Pre-Authenticated Roster Subscription (XEP-0379) . Furthermore, this heavily builds upon the blocks provided in XEP-0379 for landing page and roster subscription.
To create out-of-band invitation links, Romeo's server needs to implement the Ad-Hoc Commands (XEP-0050)  commands specified in the following section, and his client must be able to execute them.
Furthermore, Romeo's server SHOULD provide a HTTPS service hosting the landing page.
Romeo can query his server for the availability of "User Invitation" and "Account Creation" commands:
TODO: use appropriate node namespace.
When performing the account creation, Juliet's client needs to ensure that the server supports the extended IBR protocol with a <preauth> token: TODO
A user can execute the 'invite' command to obtain a new invitation link with a unique invitation token.
The token should be unique, sufficiently long and generated by a strong random number generator.
A server MUST provide the uri field which contains an XMPP URI of the following format:
The ibr query component in the XMPP URI indicates that the invitee is allowed to create an account on Romeo's server, using the 'preauth' token. If the server does not support or allow in-band registration for invited users, the server MUST omit the ibr query component.
Additionally, the server SHOULD provide the landing-url field which contains an HTTPS URL of a web-based landing page as described in Pre-Authenticated Roster Subscription (XEP-0379)  § 3.3. The URL format may differ from the example shown here depending on where the landing page is hosted.
If the server omits the landing-page field, Romeo's client SHOULD generate an appropriate landing page URL hosted by the client developer or a trusted third party.
A server MAY provide a field which provides the expiration date of the generated token. The expiration date MUST conform to the DateTime profile specified in XMPP Date and Time Profiles (XEP-0082) . If the field is not provided, the token does not expire.
Romeo's client should provide adequate means to export the landing-page URL, possibly accompanied with a short description and the expire information, so that Romeo can share it with Juliet by other means than XMPP, like e-mail or a QR code.
The landing page that the generated URL points to should correspond to the format described in XEP-0379 §3.3, and it needs to convey the following information:
If the landing page is hosted by Romeo's server, the server MAY display additional information based on the supplied TOKEN value, like the name of the inviter or validity information.
If Juliet does not have an XMPP client installed, she will not be able to open the xmpp: link from the invitation page. For this case, the landing page needs to indicate that a client must be installed first, and that the link will not work as intended without. The automatic installation of an appropriate IM client when a user clicks on an xmpp: is outside of the scope of this document.
With an XMPP client installed, Juliet can open the xmpp: link and have the client process it appropriately, as follows:
If Juliet's client is already configured with an account, the default action for the presented xmpp:email@example.com?roster;... URI is to add the inviter to Juliet's roster. This should be performed as described in §3.4 of XEP-0379, by sending a presence subscription request containing the 'preauth' token.
If Juliet already has Romeo in her roster, her client should open the appropriate chat interface instead.
If Juliet's client does not have an XMPP account configured, she needs to login or register an account first. Therefore, the client should provide an interface with the following options:
If the xmpp: URI provided by Romeo contains the ibr=y parameter, it indicates that the server supports the Pre-Authenticated In-Band Registration defined in this document. If Juliet chooses this approach, the server will ensure that after the registration, Romeo is added to her roster with a full presence subscription.
If Juliet chooses to login or register with a different server, her client must complete the respective process and issue a subscription request as described in §3.4 of XEP-0379.
If Romeo is the administrator of an XMPP server, he might want to ensure that Juliet obtains an account on this server, with a username defined either by Romeo or by Juliet, and in a way that does not require the out-of-band communication of user passwords.
TODO: description of overall process steps, design motivation.
A server MAY require a username to be specified for account creation. In this case, the server MUST add the <required/> element to the username field. The username MUST be a valid localpart as defined in RFC 6122  §2.3.
The server's response for account creation is the same as for user invitation except for the format of the uri field which contains an XMPP URI of the following format:
If no username was specified during the account creation process, the local part of the JID in the XMPP URI is omitted by the server which results in the following format:
TODO: note about sensitivity of TOKEN
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 MUST add a <preauth> element in the 'TODO' namespace to the 'jabber:iq:register' query in order to inform the server that it wants to perform Pre-Authenticated IBR:
If the server supports and is ready to perform Pre-Authenticated IBR, it MUST add a <token> element to the response (TODO: 'token' or 'preauth'?):
After the invitee has successfully registered on the inviter's server and roster subscription is enabled for account creation, the server MUST use roster pushes as defined in RFC 6121  §2.1.6 in order to inform the inviter about the invitee's new account without the need to reconnect.
If a username was specified during the account creation process, 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) .
As authorized by XMPP URI Query Components (XEP-0147) , the XMPP Registrar maintains a registry of queries and key-value pairs for use in XMPP URIs (see <https://xmpp.org/registrar/querytypes.html>).
The key-value parameter preauth is added to the register query action as defined in In-Band Registration (XEP-0077) 
In addition to the preauth key-value parameter define in Pre-Authenticated Roster Subscription (XEP-0379) , the ibr parameter is added to the roster query action.
REQUIRED for protocol specifications.
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.
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".
9. 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/
Used Data Forms for extension of In-Band Registration as required by XEP-0077 § 4.
Added "defined condition" elements in error stanzas as required by RFC 6120 § 8.3.2.
Changed type of "invalid-token" error to "modify".
Fix namespacing of Ad-Hoc commands
Bump namespace to invite:1