1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-24 18:22:24 -05:00

Merge branch 'feature/xep-0389'

This commit is contained in:
Jonas Schäfer 2020-04-28 19:32:30 +02:00
commit 635cf93358

View File

@ -31,6 +31,21 @@
<supersededby/> <supersededby/>
<shortname>ibr2</shortname> <shortname>ibr2</shortname>
&sam; &sam;
<revision>
<version>0.4.0</version>
<date>2020-04-22</date>
<initials>ssw</initials>
<remark>
<ul>
<li>Add OOB challenge type.</li>
<li>Add IQ query for flows.</li>
<li>Add a glossary.</li>
<li>Make challenge listings more consistent.</li>
<li>Cleanup and expand the registrar considerations section.</li>
<li>Clarifications and typo fixes throughout the text.</li>
</ul>
</remark>
</revision>
<revision> <revision>
<version>0.3.0</version> <version>0.3.0</version>
<date>2020-04-19</date> <date>2020-04-19</date>
@ -87,7 +102,7 @@
To solve these issues this specification provides a new in-band registration To solve these issues this specification provides a new in-band registration
protocol that allows servers to present the user with a series of protocol that allows servers to present the user with a series of
"challenges". "challenges".
This allows for both multi-stage proof-of-posession registration flows and This allows for both multi-stage proof-of-possession registration flows and
spam prevention mechanisms such as proof-of-work functions. spam prevention mechanisms such as proof-of-work functions.
</p> </p>
</section1> </section1>
@ -117,6 +132,39 @@
</li> </li>
</ul> </ul>
</section1> </section1>
<section1 topic='Glossary' anchor='glossary'>
<dl>
<di>
<dt>Challenge</dt>
<dd>
A challenge is an action taken during account registration or recovery
that requires a response.
For example, displaying a form to a user or asking for a token.
</dd>
</di>
<di>
<dt>Challenge Type</dt>
<dd>
The type of a challenge is a unique string that identifies the type of
payload that can be expected.
For example, a challenge element with type "jabber:x:data" can be
expected to contain a data form.
Challenge types must be defined and registered in the challenge types
registry.
When defining a challenge it is often convenient to reuse an XML
namespace from the document defining the challenge.
</dd>
</di>
<di>
<dt>Flow</dt>
<dd>
A flow, or more specifically a "registration flow" or "recovery flow",
is a collection of challenges that together can be used to gather enough
information to register a new account or recover an existing account.
</dd>
</di>
</dl>
</section1>
<section1 topic='Use Cases' anchor='usecases'> <section1 topic='Use Cases' anchor='usecases'>
<ul> <ul>
<li> <li>
@ -140,7 +188,7 @@
continue. continue.
</li> </li>
<li> <li>
As a server operator I want to prevent SPIM using a proof-of-posession As a server operator I want to prevent SPIM using a proof-of-possession
protocol so I present the user with a form asking for a mobile phone protocol so I present the user with a form asking for a mobile phone
number and then send a verification code to that number via SMS and show number and then send a verification code to that number via SMS and show
another form requesting the verification code. another form requesting the verification code.
@ -166,8 +214,8 @@
</p> </p>
<p> <p>
For recovery or registration, the server MUST include a list of all For recovery or registration, the server MUST include a list of all
challenge types which the client may receive during the course of challenges which the client may receive during the course of registering or
registering or recovering an account. recovering an account.
These are grouped into "flows" and let the client pick a registration These are grouped into "flows" and let the client pick a registration
workflow that only contains challenges which the client supports. workflow that only contains challenges which the client supports.
Each &lt;flow/&gt; element MUST have a unique "id" attribute which is used Each &lt;flow/&gt; element MUST have a unique "id" attribute which is used
@ -178,22 +226,22 @@
for the "xml:lang" attribute. for the "xml:lang" attribute.
Clients MAY use the name element to show the different flows to the user and Clients MAY use the name element to show the different flows to the user and
ask them to pick between them. ask them to pick between them.
Each flow must also contain a list of &lt;challenge/&gt; elements Each flow must also contain an unordered set of &lt;challenge/&gt; elements
representing the various challenges that must be completed to complete the representing the various challenges that must be completed to complete the
registration or recovery flow. registration or recovery flow.
Each &lt;challenge/&gt; element contains a string that uniquely (within the Each &lt;challenge/&gt; element contains a "type" attribute that uniquely
given parent element) identifies the type of challenge that will be offered. identifies the challenge for the purpose of determining if it is supported.
If a flow would offer the same challenge twice (eg. two dataforms asking for If a flow would offer the same challenge twice (eg. two data forms asking
different data), the challenge SHOULD only be listed once in the flow for different data), the challenge SHOULD only be listed once in the flow
element. element.
</p> </p>
<p> <p>
For example, a server may advertise a "Verify with SMS" flow and a "Verify 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 by Phone Call" flow that both show a data form asking for a phone number
and then a second dataform asking for a token provided to the user in a and then a second data form asking for a token provided to the user in a
text message or phone call depending on which flow the user selects. text message or phone call depending on which flow the user selects.
</p> </p>
<example caption="Host Advertises Stream Features"><![CDATA[ <example caption='Host Advertises Stream Features'><![CDATA[
<stream:features> <stream:features>
<mechanisms xmlns='urn:xmpp:sasl:0'> <mechanisms xmlns='urn:xmpp:sasl:0'>
<mechanism>EXTERNAL</mechanism> <mechanism>EXTERNAL</mechanism>
@ -202,28 +250,28 @@
<mechanism>PLAIN</mechanism> <mechanism>PLAIN</mechanism>
</mechanisms> </mechanisms>
<register xmlns='urn:xmpp:register:0'> <register xmlns='urn:xmpp:register:0'>
<flow id="0"> <flow id='0'>
<name>Verify with SMS</name> <name>Verify with SMS</name>
<challenge>jabber:x:data</challenge> <challenge type='jabber:x:data'/>
</flow> </flow>
<flow id="1"> <flow id='1'>
<name>Verify by Phone Call</name> <name>Verify by Phone Call</name>
<challenge>jabber:x:data</challenge> <challenge type='jabber:x:data'/>
</flow> </flow>
<flow id="2"> <flow id='2'>
<name>Verify with the web</name> <name>Verify with the web</name>
<challenge>jabber:x:data</challenge> <challenge type='jabber:x:data'/>
<challenge>jabber:x:oob</challenge> <challenge type='jabber:x:oob'/>
</flow> </flow>
</register> </register>
<recovery xmlns='urn:xmpp:register:0'> <recovery xmlns='urn:xmpp:register:0'>
<flow id="0"> <flow id='0'>
<name>Visit Password Recovery Site</name> <name>Visit Password Recovery Site</name>
<challenge>jabber:x:oob</challenge> <challenge type='jabber:x:oob'/>
</flow> </flow>
</recovery> </recovery>
</stream:features>]]></example> </stream:features>]]></example>
</section2> </section2>
<section2 topic='Service Discovery'> <section2 topic='Service Discovery'>
<p> <p>
Clients, servers, and other services such as components that support Clients, servers, and other services such as components that support
@ -231,8 +279,55 @@
fact by including a feature of "urn::xmpp:register:0" in response to fact by including a feature of "urn::xmpp:register:0" in response to
&xep0030; information requests and in their &xep0115; profiles. &xep0030; information requests and in their &xep0115; profiles.
</p> </p>
<example caption='Disco response'><![CDATA[ <example caption='Disco info response'><![CDATA[
<feature var='urn:xmpp:register:0' />]]></example> <query xmlns='http://jabber.org/protocol/disco#info'>
<feature var='urn:xmpp:register:0' />
</query>]]></example>
</section2>
<section2 topic='Retrieving the Flows'>
<p>
To find what flows an entity provides (if any) after stream negotiation is
complete the requester can send an IQ of type "get" containing a
&lt;register&gt; or &lt;recovery&gt; element qualified by the
"urn:xmpp:register:0" namespace.
</p>
<p>
When responding to a query for registration or recovery flows the list of
challenges should be included just as it would be if during stream feature
negotiation.
That is, a "register" or "recovery" element containing a list of flows,
each with an id, containing a name and a list of challenges.
If an entity supports this specification but does not provide any flows
after stream negotiation it MUST respond with an empty list.
</p>
<example caption='Registration flows query'><![CDATA[
<iq type='get'>
<register xmlns='urn:xmpp:register:0'/>
</iq>]]></example>
<example caption='Registration flows results'><![CDATA[
<iq type='result'>
<register xmlns='urn:xmpp:register:0'>
<flow id='0'>
<name>Verify with SMS</name>
<challenge type='jabber:x:data'/>
</flow>
<flow id='1'>
<name>Verify by Phone Call</name>
<challenge type='jabber:x:data'/>
</flow>
<flow id='2'>
<name>Verify with the web</name>
<challenge type='jabber:x:data'/>
<challenge type='jabber:x:oob'/>
</flow>
</register>
</iq>]]></example>
<example caption='Empty registration flows results'><![CDATA[
<iq type='result'>
<register xmlns='urn:xmpp:register:0'/>
</iq>]]></example>
</section2> </section2>
</section1> </section1>
<section1 topic='Challenges' anchor='challenge'> <section1 topic='Challenges' anchor='challenge'>
@ -244,19 +339,19 @@
For example, to select the "Verify by Phone Call" registration flow from For example, to select the "Verify by Phone Call" registration flow from
the previous example, the client would reply with: the previous example, the client would reply with:
</p> </p>
<example caption="Client selects a recovery flow"><![CDATA[ <example caption='Client selects a recovery flow'><![CDATA[
<register xmlns='urn:xmpp:register:0'> <register xmlns='urn:xmpp:register:0'>
<flow id="1"/> <flow id='1'/>
</register>]]></example> </register>]]></example>
<p> <p>
If the client is initiating registration or recovery after a stream has If the client is initiating registration or recovery after a stream has
already been initiated it uses the same registration element wrapped in an already been initiated it uses the same registration element wrapped in an
IQ of type "set". IQ of type "set".
</p> </p>
<example caption="Client selects a recovery flow after stream negotiation"><![CDATA[ <example caption='Client selects a recovery flow after stream negotiation'><![CDATA[
<iq type="set" id="foo"> <iq type='set' id='foo'>
<recovery xmlns='urn:xmpp:register:0'> <recovery xmlns='urn:xmpp:register:0'>
<flow id="0"/> <flow id='0'/>
</recovery> </recovery>
</iq>]]></example> </iq>]]></example>
<p> <p>
@ -264,19 +359,31 @@
If replying to an IQ, the challenge must be wrapped in an IQ of type If replying to an IQ, the challenge must be wrapped in an IQ of type
"result". "result".
Challenges take the form of a &lt;challenge/&gt; element qualified by the Challenges take the form of a &lt;challenge/&gt; element qualified by the
'urn:xmpp:register:0' namespace with a 'type' attribute containing the 'urn:xmpp:register:0' namespace with a 'type' attribute that uniquely
challenge type and containing a challenge data payload. identifies the type of payload a client might expect the element to contain.
</p> </p>
<example caption='Server issues a challenge'><![CDATA[
<challenge xmlns='urn:xmpp:register:0'
type='urn:example:challenge'>
<example xmlns='urn:example:challenge'>Payload</example>
</challenge>]]></example>
<p> <p>
Type type of a challenge is a value which identifes what sort of payload a After a challenge is received, the client replies to the challenge by
client might expect. sending a &lt;response/&gt; element qualified by the 'urn:xmpp:register:0'
This document defines a type of 'jabber:x:data' which MUST always contain a namespace or a cancellation as defined later in this document.
data form (an 'x' element with type 'form') as defined by &xep0004;. If the client sends a response, it MUST also include the payload
Other types may be defined in the future. corresponding to the challenges 'type' element (which may be empty).
For example, a challenge containing a data form might look like the
following:
</p> </p>
<example caption='Host Returns Registration Form to Entity'><![CDATA[ <example caption='Client responds to a challenge'><![CDATA[
<response xmlns='urn:xmpp:register:0'>
<result xmlns='urn:example:challenge'>Example Response</result>
</response>]]></example>
<section2 topic='Data Form' anchor='dataform'>
<p>
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 &xep0004;.
</p>
<example caption='Server issues a data form challenge'><![CDATA[
<challenge xmlns='urn:xmpp:register:0' <challenge xmlns='urn:xmpp:register:0'
type='jabber:x:data'> type='jabber:x:data'>
<x xmlns='jabber:x:data' type='form'> <x xmlns='jabber:x:data' type='form'>
@ -297,20 +404,14 @@
<required/> <required/>
</field> </field>
</x> </x>
</challenge> </challenge>]]></example>
]]></example>
<p> <p>
After a challenge is received, the client replies to the challenge by The response to a "jabber:x:data" challenge MUST be a form submission (an
sending a &lt;response/&gt; element qualified by the 'urn:xmpp:register:0' 'x' element of type 'submit').
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 &xep0004; (an 'x' element of type 'submit').
For instance, to reply to the data form challenge from the previous example For instance, to reply to the data form challenge from the previous example
a client might send: a client might send:
</p> </p>
<example caption='User Submits Registration Form'><![CDATA[ <example caption='Client submits a data form in response to the challenge'><![CDATA[
<response xmlns='urn:xmpp:register:0'> <response xmlns='urn:xmpp:register:0'>
<x xmlns='jabber:x:data' type='submit'> <x xmlns='jabber:x:data' type='submit'>
<field type='hidden' var='FORM_TYPE'> <field type='hidden' var='FORM_TYPE'>
@ -329,8 +430,26 @@
<value>juliet@capulet.com</value> <value>juliet@capulet.com</value>
</field> </field>
</x> </x>
</response> </response>]]></example>
]]></example> </section2>
<section2 topic='Out of Band Data' anchor='oob'>
<p>
Challenges of the type "jabber:x:oob" MUST contain an &lt;x/&gt; element
qualified by the "jabber:x:oob" namespace as defined in &xep0066;.
</p>
<example caption='Server issues an OOB challenge'><![CDATA[
<challenge xmlns='urn:xmpp:register:0'
type='jabber:x:oob'>
<x xmlns='jabber:x:oob'>
<url>http://example.net/login?token=foo</url>
</x>
</challenge>]]></example>
<p>
If the client sends a response to the OOB challenge it MUST be empty.
</p>
<example caption='Client acknowledges the OOB challenge'><![CDATA[
<response xmlns='urn:xmpp:register:0'/>]]></example>
</section2>
</section1> </section1>
<section1 topic='Completing Registration or Recovery' anchor='completion'> <section1 topic='Completing Registration or Recovery' anchor='completion'>
<p> <p>
@ -348,8 +467,8 @@
wishes to cancel the flow, it MAY respond to any IQ from the client with the wishes to cancel the flow, it MAY respond to any IQ from the client with the
cancel element and type "result". cancel element and type "result".
</p> </p>
<example caption='Server cancels rquest'><![CDATA[ <example caption='Server cancels request'><![CDATA[
<iq type="result" id="bar"> <iq type='result' id='bar'>
<cancel xmlns='urn:xmpp:register:0'/> <cancel xmlns='urn:xmpp:register:0'/>
</iq>]]></example> </iq>]]></example>
<p> <p>
@ -367,8 +486,8 @@
If the IQ based flow is being used and the server wishes to indicate success If the IQ based flow is being used and the server wishes to indicate success
it sends an empty IQ response of type "result". it sends an empty IQ response of type "result".
</p> </p>
<example caption='Server indicates success after stream negotation'><![CDATA[ <example caption='Server indicates success after stream negotiation'><![CDATA[
<iq type="result" id="bar" />]]></example> <iq type='result' id='bar' />]]></example>
</section1> </section1>
<section1 topic='Internationalization Considerations' anchor='i18n'> <section1 topic='Internationalization Considerations' anchor='i18n'>
<p> <p>
@ -387,7 +506,7 @@
Servers that allow in-band registration need to take measures to prevent Servers that allow in-band registration need to take measures to prevent
abuse. abuse.
Common techniques to prevent spam registrations include displaying CAPTCHAs Common techniques to prevent spam registrations include displaying CAPTCHAs
or requiring proof-of-posession of a valid email address or telephone number or requiring proof-of-possession of a valid email address or telephone number
by sending a unique code (e.g. an HMAC that can later be verified as having 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 originated at the server) to the users email and requiring that they enter
the code before continuing. the code before continuing.
@ -407,27 +526,51 @@
<p> <p>
Upon advancement of this specification from a status of Experimental to a Upon advancement of this specification from a status of Experimental to a
status of Draft, the &REGISTRAR; shall add the foregoing namespace to the status of Draft, the &REGISTRAR; shall add the foregoing namespace to the
registry located at &STREAMFEATURES;, as described in Section 4 of registries located at &STREAMFEATURES;, and &DISCOFEATURES; as described
&xep0053;. in Section 4 of &xep0053;.
</p> </p>
</section2> <code caption='Service Discovery Features Registry Submission'><![CDATA[
<section2 topic='IBR Challenge Types Registry' anchor='registrar-challenges'> <var>
<name>urn:xmpp:register:0</name>
<desc>Support for in band registration and password reset.</desc>
<doc>&xep0389;</doc>
</var>]]></code>
<code caption='Stream Features Registry Submission'><![CDATA[
<feature>
<ns>urn:xmpp:register:0</ns>
<name>Extensible In-Band Registration</name>
<element>register</element>
<desc>Support for in band registration and password reset.</desc>
<doc>&xep0389;</doc>
</feature>]]></code>
<p> <p>
The XMPP Registrar shall maintain a registry of IBR challenge types. The &REGISTRAR; shall also add the foregoing namespace to the Jabber/XMPP
Challenge types defined within the XEP series MUST be registered with the Protocol Namespaces Registry located at &NAMESPACES;.
XMPP Registrar. Upon advancement of this specification from a status of Experimental to a
status of Draft, the &REGISTRAR; shall remove the provisional status from
this registry entry.
</p>
<code caption='Jabber/XMPP Protocol Namespaces Registry Submission'><![CDATA[
<ns>
<name>urn:xmpp:register:0</name>
<doc>&xep0389;</doc>
<status>provisional</status>
</ns>]]></code>
</section2>
<section2 topic='IBR Challenges Registry' anchor='registrar-challenges'>
<p>
The XMPP Registrar shall maintain a registry of IBR challenges.
Challenges defined within the XEP series MUST be registered with the XMPP
Registrar.
</p> </p>
&REGPROCESS; &REGPROCESS;
<code><![CDATA[ <code><![CDATA[
<challenge> <challenge>
<name>The name of the challenge type.</name> <type>A name that uniquely identifies the challenge.</type>
<desc>A natural-language summary of the challenge.</desc> <desc>A natural-language summary of the challenge.</desc>
<payloaddoc>
The document in which the IBR challenge payload is specified.
</payloaddoc>
<doc> <doc>
The doucment in which the IBR challenge itself is specified (may be the same The document (or documents) in which the IBR challenge and its payload are
as <payloaddoc/>). defined.
</doc> </doc>
</challenge>]]></code> </challenge>]]></code>
<p> <p>
@ -435,22 +578,28 @@
</p> </p>
</section2> </section2>
<section2 topic='Challenge Types' anchor='registrar-ibrchallenges'> <section2 topic='Challenge Types' anchor='registrar-ibrchallenges'>
<p>This specification defines the following IBR challenge types:</p> <p>This specification defines the following IBR challenge:</p>
<ul> <ul>
<li>jabber:x:data</li> <li>jabber:x:data</li>
<li>jabber:x:oob</li>
</ul> </ul>
<p> <p>
Upon advancement of this specification from a status of Experimental to a Upon advancement of this specification from a status of Experimental to a
status of Draft, the &REGISTRAR; shall add the following definition to the status of Draft, the &REGISTRAR; shall add the following definitions to
IBR challenge types registry, as described in this document: the IBR challenges registry, as described in this document:
</p> </p>
<code><![CDATA[ <code caption='IBR Challenges Registry Submission for Data Forms'><![CDATA[
<challenge> <challenge>
<name>Data Forms Challenge</name> <type>jabber:x:data</type>
<desc>Requests that the client fill out an XEP-0004 data form.</desc> <desc>Requests that the client fill out an XEP-0004 data form.</desc>
<payloaddoc>XEP-0004</payloaddoc> <doc>&xep0389;, &xep0004;</doc>
<doc>TODO: Insert this document once it is assigned a number</doc> </challenge>]]></code>
</profile>]]></code> <code caption='IBR Challenges Registry Submission for OOB Data'><![CDATA[
<challenge>
<type>jabber:x:oob</type>
<desc>Requests that the client execute a URI.</desc>
<doc>&xep0066;</doc>
</challenge>]]></code>
</section2> </section2>
<section2 topic='Namespace Versioning' anchor='registrar-versioning'> <section2 topic='Namespace Versioning' anchor='registrar-versioning'>
&NSVER; &NSVER;