XEP-xxxx: Pre-Authenticated In-Band Registration

Abstract
This document extends the In-Band-Registration protocol to use invitation tokens, e.g. for registering accounts on non-public servers.
Author
Georg Lukas
Copyright
© 2020 – 2020 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status

ProtoXEP

WARNING: This document has not yet been accepted for consideration or approved in any official manner by the XMPP Standards Foundation, and this document is not yet an XMPP Extension Protocol (XEP). If this document is accepted as a XEP by the XMPP Council, it will be published at <https://xmpp.org/extensions/> and announced on the <standards@xmpp.org> mailing list.
Type
Standards Track
Version
0.1.0 (2020-10-28)
Document Lifecycle
  1. Experimental
  2. Proposed
  3. Stable
  4. Final

1. Introduction

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) [3], 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.

2. Use Cases

A client that implements this specification needs to understand the XMPP URI Query Components (XEP-0147) [4] specification, to make use of the register query action and the preauth parameter. Three URI formats are defined.

2.1 Registration with pre-defined account name

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.

Registration URI with pre-defined account name
xmpp:juliet@example.com?register;preauth=TOKEN

2.2 Registration on a server

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.

Registration URI without account name
xmpp:example.com?register;preauth=TOKEN

2.3 Contact Invitation with IBR

A contact invitation with a registration token (Pre-Authenticated Roster Subscription (XEP-0379) [2]) might indicate that the token can also be used to register an account on that server (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.

Contact URI with Pre-Authenticated IBR support
xmpp:romeo@example.com?roster;preauth=TOKEN;ibr=y

3. Discovery

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:invite'> stream feature:

Example 1. Stream features of a server that accepts invitations
<stream:features>
  <mechanisms xmlns='urn:xmpp:sasl:0'>
    <mechanism>EXTERNAL</mechanism>
    <mechanism>SCRAM-SHA-1-PLUS</mechanism>
    <mechanism>SCRAM-SHA-1</mechanism>
    <mechanism>PLAIN</mechanism>
  </mechanisms>
  <register xmlns='urn:xmpp:invite'/>
  <register xmlns='http://jabber.org/features/iq-register'/>
</stream:features>

4. Pre-Authenticated In-Band Registration

In order to allow invited users to register on a server, the registration processs as defined in In-Band Registration (XEP-0077) [1] 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:invite'>) is present. After that, the client initiates the registration flow by sending the preauth token to the server:

Example 2. Client initiates pre-authenticated IBR
<iq type='set' to='example.com' id='pa1'>
<preauth xmlns='urn:xmpp:pars:0' token='TOKEN' />
</iq>

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:

Example 3. Server accepts invitation token
<iq type='result' from='example.com' id='pa1' />

If the token provided by the client was unknown, invalid or expired, the server should return an appropriate error to the client:

Example 4. Server rejects invitation token
<iq type="error" from="example.com" id="pa1">
<error type='cancel'>
  <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  <text>The provided token is invalid or expired</text>
</error>
</iq>

In the success case, the client proceeds with registration as defined in In-Band Registration (XEP-0077) [1]. If the token is rejected by the server, the client still MAY attempt to perform IBR if the server allows that.

5. Business Rules

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.

6. Implementation Notes

6.1 XMPP Server Suggestion for Invitees

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.

7. Security Considerations

See security considerations in Pre-Authenticated Roster Subscription (XEP-0379) [2].

8. IANA Considerations

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

9. XMPP Registrar Considerations

This document only makes use of the XMPP URI elements defined in Easy User Onboarding (XEP-0401) [3]

10. XML Schema

REQUIRED for protocol specifications.


Appendices

Appendix A: Document Information

Series
XEP
Number
xxxx
Publisher
XMPP Standards Foundation
Status
ProtoXEP
Type
Standards Track
Version
0.1.0
Last Updated
2020-10-28
Approving Body
XMPP Council
Dependencies
XMPP Core, XEP-0077, XEP-0147, XEP-0379, XEP-0401
Supersedes
None
Superseded By
None
Short Name
ibr-token

This document in other formats: XML  PDF

Appendix B: Author Information

Georg Lukas

Copyright

This XMPP Extension Protocol is copyright © 1999 – 2024 by the XMPP Standards Foundation (XSF).

Permissions

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 <https://xmpp.org/community/> 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-0379: Pre-Authenticated Roster Subscription <https://xmpp.org/extensions/xep-0379.html>.

3. XEP-0401: Easy User Onboarding <https://xmpp.org/extensions/xep-0401.html>.

4. XEP-0147: XMPP URI Query Components <https://xmpp.org/extensions/xep-0147.html>.

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

Appendix H: Revision History

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

  1. Version 0.1.0 (2020-10-28)
    First version based on XEP-0401.
    gl

Appendix I: Bib(La)TeX Entry

@report{lukas2020ibr-token,
  title = {Pre-Authenticated In-Band Registration},
  author = {Lukas, Georg},
  type = {XEP},
  number = {xxxx},
  version = {0.1.0},
  institution = {XMPP Standards Foundation},
  url = {https://xmpp.org/extensions/xep-xxxx.html},
  date = {2020-10-28/2020-10-28},
}

END