No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0389.xml 15KB

  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. <!ENTITY bcp47 "<span class='ref'><link url=''>BCP 47</link></span> <note>BCP 47: Tags for Identifying Languages &lt;<link url=''></link>&gt;.</note>" >
  6. ]>
  7. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  8. <xep>
  9. <header>
  10. <title>Extensible In-Band Registration</title>
  11. <abstract>
  12. This specification defines an XMPP protocol extension for in-band
  13. registration with instant messaging servers and other services with which an
  14. XMPP entity may initiate a stream.
  15. It aims to improve upon the state of the art and replace XEP-0077: In-Band
  16. Registration by allowing multi-factor registration mechanisms, and account
  17. recovery.
  18. </abstract>
  20. <number>0389</number>
  21. <status>Experimental</status>
  22. <type>Standards Track</type>
  23. <sig>Standards</sig>
  24. <approver>Council</approver>
  25. <dependencies>
  26. <spec>XMPP Core</spec>
  27. </dependencies>
  28. <supersedes>
  29. <spec>XEP-0077</spec>
  30. </supersedes>
  31. <supersededby/>
  32. <shortname>ibr2</shortname>
  33. &sam;
  34. <revision>
  35. <version>0.1.0</version>
  36. <date>2017-03-16</date>
  37. <initials>XEP Editor (ssw)</initials>
  38. <remark>
  39. <ul>
  40. <li>Move to experimental.</li>
  41. </ul>
  42. </remark>
  43. </revision>
  44. <revision>
  45. <version>0.0.2</version>
  46. <date>2017-02-15</date>
  47. <initials>ssw</initials>
  48. <remark>
  49. <ul>
  50. <li>Don't allow feature to act as auth.</li>
  51. <li>Use a more conventional list for challenge type listings.</li>
  52. </ul>
  53. </remark>
  54. </revision>
  55. <revision>
  56. <version>0.0.1</version>
  57. <date>2017-02-08</date>
  58. <initials>ssw</initials>
  59. <remark><p>First draft.</p></remark>
  60. </revision>
  61. </header>
  62. <section1 topic='Introduction' anchor='intro'>
  63. <p>
  64. Historically, registering with an XMPP service has been difficult. Each
  65. server either used customized out-of-band registration mechanisms such as
  66. web forms which were difficult to discover, or they used &xep0077; which
  67. could easily be abused by spammers to register large numbers of accounts and
  68. which allowed for only limited extensibility.
  69. </p>
  70. <p>
  71. To solve these issues this specification provides a new in-band registration
  72. protocol that allows servers to present the user with a series of
  73. "challenges".
  74. This allows for both multi-stage proof-of-posession registration flows and
  75. spam prevention mechanisms such as proof-of-work functions.
  76. </p>
  77. </section1>
  78. <section1 topic='Requirements' anchor='reqs'>
  79. <ul>
  80. <li>
  81. The server MUST be able to present multiple challenges to the client.
  82. </li>
  83. <li>
  84. The server SHOULD be able reduce account registration spam.
  85. </li>
  86. <li>
  87. The server MAY present a challenge that requires the user to complete a
  88. step out-of-band.
  89. </li>
  90. <li>
  91. A client SHOULD be able to register an account without requiring the user
  92. to leave the client.
  93. </li>
  94. <li>
  95. A client MUST be able to use the same mechanism to register an account and
  96. to recover a forgotten password (subject to server policy).
  97. </li>
  98. </ul>
  99. </section1>
  100. <section1 topic='Glossary' anchor='glossary'>
  101. <dl>
  102. <di>
  103. <dt>Proof-of-work (PoW)</dt>
  104. <dd>
  105. A proof-of-work protocol requires that a client perform a
  106. computationally intense task which is easily verified by the server.
  107. </dd>
  108. </di>
  109. <di>
  110. <dt>Proof-of-possession (PoP)</dt>
  111. <dd>
  112. A proof-of-possession protocol requires that a client prove that they
  113. have posession of some resource (eg. a shared secret, or a valid mobile
  114. phone number).
  115. </dd>
  116. </di>
  117. </dl>
  118. </section1>
  119. <section1 topic='Use Cases' anchor='usecases'>
  120. <ul>
  121. <li>
  122. As a server operator, I want to prevent individual spammers from
  123. registering many accounts so I require registrants to perform a
  124. proof-of-work function before registration is completed.
  125. </li>
  126. <li>
  127. As a server operator I want to prevent zombie machines from registering
  128. for accounts so I require that registrants submit a form which requires
  129. user interaction.
  130. </li>
  131. <li>
  132. As a user I do not want to lose access to my account if I forget my
  133. password, so I provide my email and telephone number in response to the
  134. servers data form.
  135. </li>
  136. <li>
  137. As a server operator I do not want users to accidentally add an incorrect
  138. recovery address so I send an email with a unique link to the indicated
  139. account and require that they click the link before registration can
  140. continue.
  141. </li>
  142. <li>
  143. As a server operator I want to prevent SPIM using a proof-of-posession
  144. protocol so I present the user with a form asking for a mobile phone
  145. number and then send a verification code to that number via SMS and show
  146. another form requesting the verification code.
  147. </li>
  148. </ul>
  149. </section1>
  150. <section1 topic='Discovering Support' anchor='disco'>
  151. <p>
  152. If a server supports registering for or recovering an account using
  153. Extensible IBR, it MUST inform the connecting client when returning stream
  154. features during the stream negotiation process.
  155. This is done by including a &lt;register/&gt; element, qualified by the
  156. 'urn:xmpp:register:0' namespace for account registration, or a
  157. &lt;recovery/&gt; element qualified by the same namespace for account
  158. recovery.
  159. The register and recovery features are always voluntary-to-negotiate.
  160. The registration and recovery features MUST NOT be advertised before
  161. encryption has been negotiated, eg. using direct-TLS or STARTTLS.
  162. They SHOULD be advertised at the same time as the SASL authentication
  163. feature, meaning that after registration or recovery is completed SASL
  164. authentication can proceed.
  165. </p>
  166. <p>
  167. For recovery or registration, the server MUST include a list of all
  168. challenge types which the client may receive during the course of
  169. registering or recovering an account.
  170. The purpose of this list is to allow clients to detect if registration
  171. requires a challenge type which the client does not support, so servers
  172. SHOULD only include each type once; the list is merely informative, and
  173. should not be relied upon by clients except to ensure that all mechanisms
  174. are supported.
  175. This list should comprise &lt;challenge/&gt; elements containing a string
  176. that uniquely identifies the type of challenge being issued.
  177. </p>
  178. <example caption="Host Advertises Stream Features"><![CDATA[
  179. <stream:features>
  180. <mechanisms xmlns='urn:xmpp:sasl:0'>
  181. <mechanism>EXTERNAL</mechanism>
  182. <mechanism>SCRAM-SHA-1-PLUS</mechanism>
  183. <mechanism>SCRAM-SHA-1</mechanism>
  184. <mechanism>PLAIN</mechanism>
  185. </mechanisms>
  186. <register xmlns='urn:xmpp:register:0'>
  187. <challenge>jabber:x:data'</challenge>
  188. <challenge>pow-example</challenge>
  189. </register>
  190. <recovery xmlns='urn:xmpp:register:0'>
  191. <challenge>jabber:x:oob</challenge>
  192. </recovery>
  193. </stream:features>]]></example>
  194. </section1>
  195. <section1 topic='Challenges' anchor='challenge'>
  196. <p>
  197. A client selects the registration or recovery feature for negotiation by
  198. replying with an empty element of the same name and namespace.
  199. For example, to attempt account recovery the client would send a
  200. &lt;recovery&gt; element qualified by the 'urn:xmpp:register:0' namespace.
  201. </p>
  202. <p>
  203. The server then replies with a challenge.
  204. Challenges take the form of a &lt;challenge/&gt; element qualified by the
  205. 'urn:xmpp:register:0' namespace with a 'type' attribute containing the
  206. challenge type and containing a challenge data payload.
  207. </p>
  208. <p>
  209. Type type of a challenge is a value which identifes what sort of payload a
  210. client might expect.
  211. This document defines a type of 'jabber:x:data' which MUST always contain a
  212. data form (an 'x' element with type 'form') as defined by &xep0004;.
  213. Other types may be defined in the future.
  214. For example, a challenge containing a data form might look like the
  215. following:
  216. </p>
  217. <example caption='Host Returns Registration Form to Entity'><![CDATA[
  218. <challenge xmlns='urn:xmpp:register:0'
  219. type='jabber:x:data'>
  220. <x xmlns='jabber:x:data' type='form'>
  221. <title>Chat Registration</title>
  222. <instructions>
  223. Please provide the following information
  224. to sign up to view our chat rooms!
  225. </instructions>
  226. <field type='hidden' var='FORM_TYPE'>
  227. <value>urn:xmpp:register:0</value>
  228. </field>
  229. <field type='text-single' label='Given Name' var='first'/>
  230. <field type='text-single' label='Family Name' var='last'/>
  231. <field type='text-single' label='Nickname' var='nick'>
  232. <required/>
  233. </field>
  234. <field type='text-single' label='Recovery Email Address' var='email'>
  235. <required/>
  236. </field>
  237. </x>
  238. </challenge>
  239. ]]></example>
  240. <p>
  241. After a challenge is received, the client replies to the challenge by
  242. sending a &lt;response/&gt; element qualified by the 'urn:xmpp:register:0'
  243. namespace or a cancelation as defined later in this document.
  244. If the client sends a response, it MUST also include a payload defined by
  245. the specific challenge type.
  246. In the case of a jabber:x:data challenge, the payload should be a form
  247. submission as defined by &xep0004; (an 'x' element of type 'submit').
  248. For instance, to reply to the data form challenge from the previous example
  249. a client might send:
  250. </p>
  251. <example caption='User Submits Registration Form'><![CDATA[
  252. <response xmlns='urn:xmpp:register:0'>
  253. <x xmlns='jabber:x:data' type='submit'>
  254. <field type='hidden' var='FORM_TYPE'>
  255. <value>urn:xmpp:register:0</value>
  256. </field>
  257. <field type='text-single' label='Given Name' var='first'>
  258. <value>Juliet</value>
  259. </field>
  260. <field type='text-single' label='Family Name' var='last'>
  261. <value>Capulet</value>
  262. </field>
  263. <field type='text-single' label='Nickname' var='nick'>
  264. <value>Jule</value>
  265. </field>
  266. <field type='text-single' label='Recovery Email Address' var='email'>
  267. <value></value>
  268. </field>
  269. </x>
  270. </response>
  271. ]]></example>
  272. <p>
  273. If after receiving a challenge a client does not wish to continue
  274. registration or recovery, it may send an empty &lt;cancel&gt; element
  275. qualified by the 'urn:xmpp:register:0' namespace.
  276. This informs the server that registration is complete.
  277. This is the same as submitting a data form of type 'cancel' in response to a
  278. data form challenge.
  279. </p>
  280. <example caption='User Cancels Registration or Recovery'><![CDATA[
  281. <cancel xmlns='urn:xmpp:register:0'/>
  282. ]]></example>
  283. </section1>
  284. <section1 topic='Completing Registration or Recovery' anchor='completion'>
  285. <p>
  286. If the client submits invalid data, or the server wishes to cancel for some
  287. other reason, it may reply with an empty &lt;cancel/&gt; element qualified
  288. by the 'urn:xmpp:register:0' namespace.
  289. If the client successfully completes the challenge, the server MAY return an
  290. empty &lt;success/&gt; element qualified by the 'urn:xmpp:register:0'
  291. namespace, at which point it may continue with the stream negotiation
  292. process.
  293. If the server needs more information, for example, in the previous challenge
  294. the user entered an email and now the server wishes to ask for a code that
  295. was sent to that email, the server MAY send another challenge.
  296. </p>
  297. </section1>
  298. <section1 topic='Internationalization Considerations' anchor='i18n'>
  299. <p>
  300. When providing instructions in a data form the server SHOULD use the
  301. language specified in the XML stream's current xml:lang, or the closest
  302. language for which the server has a translation (eg. based on mutual
  303. intelligibility between scripts and languages).
  304. </p>
  305. <p>
  306. For more information about language tags and matching, see &bcp47;
  307. </p>
  308. </section1>
  309. <section1 topic='Security Considerations' anchor='security'>
  310. <p>
  311. Servers that allow in-band registration need to take measures to prevent
  312. abuse.
  313. Common techniques to prevent spam registrations include displaying CAPTCHAs
  314. or requiring proof-of-posession of a valid email address or telephone number
  315. by sending a unique code (e.g. an HMAC that can later be verified as having
  316. originated at the server) to the users email and requiring that they enter
  317. the code before continuing.
  318. Servers that do not take such measures risk being black listed by other
  319. servers in the network.
  320. </p>
  321. </section1>
  322. <section1 topic='IANA Considerations' anchor='iana'>
  323. <p>This document requires no interaction with &IANA;.</p>
  324. </section1>
  325. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  326. <section2 topic='Protocol Namespaces' anchor='registrar-ns'>
  327. <p>This specification defines the following XML namespace:</p>
  328. <ul>
  329. <li>urn:xmpp:register:0</li>
  330. </ul>
  331. <p>
  332. Upon advancement of this specification from a status of Experimental to a
  333. status of Draft, the &REGISTRAR; shall add the foregoing namespace to the
  334. registry located at &STREAMFEATURES;, as described in Section 4 of
  335. &xep0053;.
  336. </p>
  337. </section2>
  338. <section2 topic='IBR Challenge Types Registry' anchor='registrar-challenges'>
  339. <p>
  340. The XMPP Registrar shall maintain a registry of IBR challenge types.
  341. Challenge types defined within the XEP series MUST be registered with the
  342. XMPP Registrar.
  343. </p>
  345. <code><![CDATA[
  346. <challenge>
  347. <name>The name of the challenge type.</name>
  348. <desc>A natural-language summary of the challenge.</desc>
  349. <payloaddoc>
  350. The document in which the IBR challenge payload is specified.
  351. </payloaddoc>
  352. <doc>
  353. The doucment in which the IBR challenge itself is specified (may be the same
  354. as <payloaddoc/>).
  355. </doc>
  356. </challenge>]]></code>
  357. <p>
  358. For an example registration, see the next section.
  359. </p>
  360. </section2>
  361. <section2 topic='Challenge Types' anchor='registrar-ibrchallenges'>
  362. <p>This specification defines the following IBR challenge types:</p>
  363. <ul>
  364. <li>jabber:x:data</li>
  365. </ul>
  366. <p>
  367. Upon advancement of this specification from a status of Experimental to a
  368. status of Draft, the &REGISTRAR; shall add the following definition to the
  369. IBR challenge types registry, as described in this document:
  370. </p>
  371. <code><![CDATA[
  372. <challenge>
  373. <name>Data Forms Challenge</name>
  374. <desc>Requests that the client fill out an XEP-0004 data form.</desc>
  375. <payloaddoc>XEP-0004</payloaddoc>
  376. <doc>TODO: Insert this document once it is assigned a number</doc>
  377. </profile>]]></code>
  378. </section2>
  379. <section2 topic='Namespace Versioning' anchor='registrar-versioning'>
  380. &NSVER;
  381. </section2>
  382. </section1>
  383. </xep>