The XMPP ecosystem has no way to allow clients to display or refer the user to the Terms of Service and Privacy Policy of any given server.
The specification shall allow to satisfy the following requirements:
OPTIONAL.
A server which supports the Terms of Service protocol announces support via both stream features and Service Discovery (XEP-0030) [2].
<stream:features> ... <tos xmlns='urn:xmpp:tos:0'/> </stream:features>
<iq type='result' from='service.example' to='requester@service.example' id='req1'> <query xmlns='http://jabber.org/protocol/disco#info'> ... <feature var='urn:xmpp:tos:0'/> ... </query> </iq>
The interaction with the Terms of Service is handled using Ad-Hoc Commands (XEP-0050) [1].
To request the current Terms of Service and Opt-ins/Opt-outs, the client starts an Ad-Hoc command session with the 'urn:xmpp:tos:0' node at its server:
<iq type='set' from='requester@service.example' to='service.example' id='cmd1' xml:lang='en'> <command xmlns='http://jabber.org/protocol/commands' node='urn:xmpp:tos:0' action='execute'> <tos-support xmlns='urn:xmpp:tos:0'/> </command> </iq>
The client MUST include a <tos-support/> child in the initial request to inform the server that it fully supports the protocol. A server MAY reject the Ad-Hoc command from a client which does not fully support the protocol if the form would likely not render correctly or completely. In that case, a <not-acceptable/> type='cancel' error MUST be returned.
The server SHOULD use the value of xml:lang at the <command/> element to determine the language of returned texts.
If the server allows the request, it starts the command session and returns the payload:
<iq type='result' to='requester@service.example' from='service.example' id='cmd1' xml:lang='en'> <command xmlns='http://jabber.org/protocol/commands' node='urn:xmpp:tos:0' sessionid='dlW81nadFUAS7VSWOOJ4e1J1' status='executing'> <actions execute='complete'> <complete/> </actions> <x xmlns='jabber:iq:data'> <field var='FORM_TYPE' type='hidden'> <value>urn:xmpp:tos:0</value> </field> <field var='urn:xmpp:tos:0#version' type='hidden'> <value>0.1.0</value> </field> <field var='urn:xmpp:tos:0#documents-header' type='fixed'> <value>Terms of Use</value> </field> <field var='urn:xmpp:tos:0#documents' type='text-multi'> <desc> The Terms of Use for this service are defined by the following documents. Please read them carefully. </desc> <value>https://service.example/tos</value> <value>https://service.example/privacy</value> </field> <field type='fixed'> <value>Opt-ins</value> </field> <field var='https://service.example/privacy' type='boolean'> <required/> <desc> I have read and understood the Privacy Policy document linked above. </desc> <value>false</value> </field> <field var='https://service.example/privacy#12.3-marketing' type='boolean'> <required/> <desc> I allow analysis of my messages under Art. 9.1a for marketing purposes (see Privacy Policy §12.3). </desc> <value>false</value> </field> </x> <tos xmlns='urn:xmpp:tos:0' version='0.1.0'> <document> <title>Terms of Service</title> <source url='https://service.example/tos' type='text/html' /> <source url='https://service.example/tos.txt' type='text/plain' /> </document> <document> <title>Privacy Policy</title> <source url='https://service.example/privacy' type='text/html' /> <source url='https://service.example/privacy.txt' type='text/plain' /> </document> <required-flags> <required-flag var='https://service.example/privacy'/> </required-flags> </tos> </command> </iq>
The command payload consists of two parts: The data form for legacy clients and additional opt-ins/opt-outs, and the machine-readable Terms of Service data. The machine-readable Terms of Service data is carried by a <tos/> element.
The <tos/> element has the following format:
In the future, more children may be added to the <tos/> element. Conforming clients thus MUST ignore all children they do not understand.
The <document/> element has the following format:
The <required-flags/> element contains zero or more <required-flag/> elements. The <required-flag/> elements have a var attribute which refers to one of the fields in the data form. Note that this is semantically different from <require/> in the data form (see Data Forms (XEP-0004) [3])
The data form has the FORM_TYPE 'urn:xmpp:tos:0'. The fields 'urn:xmpp:tos:0#version' and 'urn:xmpp:tos:0#documents' are mandatory. If the value of the 'urn:xmpp:tos:0#version' data form field and the version attribute of the <tos/> element differ, the response is invalid.
The data form MAY contain arbitrary fields after the 'urn:xmpp:tos:0#documents' field.
A client supporting the Terms of Service protocol should remove the fields prefixed with 'urn:xmpp:tos:0#' from the form when displaying the form and use a richer representation obtained from the <tos/> element for the same data.
The 'urn:xmpp:tos:0#documents' MUST contain exactly one URL from each <document/> advertised in the <tos/> element. It is used to inform users of legacy clients of the terms.
The server MAY include <instruction/> and <title/> elements in the data form.
Once the user has filled out the form, the client submits it to the server:
<iq type='set' to='service.example' from='requester@service.example' id='cmd2' xml:lang='en'> <command xmlns='http://jabber.org/protocol/commands' node='urn:xmpp:tos:0' sessionid='dlW81nadFUAS7VSWOOJ4e1J1' action='complete'> <x xmlns='jabber:iq:data'> <field var='FORM_TYPE' type='hidden'> <value>urn:xmpp:tos:0</value> </field> <field var='urn:xmpp:tos:0#version' type='hidden'> <value>0.1.0</value> </field> <field var='urn:xmpp:tos:0#documents-header' type='fixed'> <value>Terms of Use</value> </field> <field var='urn:xmpp:tos:0#documents' type='text-multi'> <value>https://service.example/tos</value> <value>https://service.example/privacy</value> </field> <field type='fixed'> <value>Opt-ins</value> </field> <field var='https://service.example/privacy' type='boolean'> <value>true</value> </field> <field var='https://service.example/privacy#12.3-marketing' type='boolean'> <value>false</value> </field> </x> </command> </iq>
The client does not include the <tos/> element in its response.
The server acknowledges the reception as usual:
<iq type='result' to='requester@service.example' from='service.example' id='cmd2' xml:lang='en'> <command xmlns='http://jabber.org/protocol/commands' node='urn:xmpp:tos:0' sessionid='dlW81nadFUAS7VSWOOJ4e1J1' status='completed'> <note type='info'>The privacy settings have been updated.</note> </command> </iq>
If the client did not include a <tos-support/> element in the initiating request and the server requires support for the Terms of Service protocol, it replies with an error:
<iq type='error' from='service.example' to='requester@service.example' id='cmd1'> <error type='cancel'> <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> <text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'> Your client does not support the Terms of Service protocol. Please review the Terms of Service online at https://service.example/tos. </text> </error> </iq>
The server SHOULD include a human readable error text which MAY include a URL to a website where the user can agree to the terms and manage the opt-ins/opt-outs.
If the user did not opt in into options required by the service, the service returns the original data to the client and adds an error note to the command:
<iq type='result' to='requester@service.example' from='service.example' id='cmd2' xml:lang='en'> <command xmlns='http://jabber.org/protocol/commands' node='urn:xmpp:tos:0' sessionid='dlW81nadFUAS7VSWOOJ4e1J1' status='executing'> <note type='error'> You have to confirm that you read and understood the Privacy Policy document below. </note> <actions execute='complete'> <complete/> </actions> <x xmlns='jabber:iq:data'> <field var='FORM_TYPE' type='hidden'> <value>urn:xmpp:tos:0</value> </field> <field var='urn:xmpp:tos:0#version' type='hidden'> <value>0.1.0</value> </field> <field var='urn:xmpp:tos:0#documents-header' type='fixed'> <value>Terms of Use</value> </field> <field var='urn:xmpp:tos:0#documents' type='text-multi'> <desc> The Terms of Use for this service are defined by the following documents. Please read them carefully. </desc> <value>https://service.example/tos</value> <value>https://service.example/privacy</value> </field> ... </x> <tos xmlns='urn:xmpp:tos:0' version='0.1.0'> <document> <title>Terms of Service</title> <source url='https://service.example/tos' type='text/html' /> <source url='https://service.example/tos.txt' type='text/plain' /> </document> ... </tos> </command> </iq>
If a server updates its Terms of Service, it may inform its users with a notification. For this, a 'headline' <message/> is used:
<message type='headline' from='service.example' to='user@service.example'> <body> We have updated our Terms of Service. Please refer to the current version at https://service.example/tos. You have to review and agree to the new version by the 25th of May 2018 to continue to use the service. </body> <tos-push xmlns='urn:xmpp:tos:0'> <tos xmlns='urn:xmpp:tos:0' version='0.2.0'> <document> <title>Terms of Service</title> <source url='https://service.example/tos-0.2.0' type='text/html' /> <source url='https://service.example/tos-0.2.0.txt' type='text/plain' /> </document> <document> <title>Privacy Policy</title> <source url='https://service.example/privacy-0.2.0' type='text/html' /> <source url='https://service.example/privacy-0.2.0.txt' type='text/plain' /> </document> </tos> <deadline>2018-05-25T00:00:00Z</deadline> </tos-push> </iq>
The <body/> is included for clients not supporting the protocol. The user can then review the Terms of Service by themselves. In addition to the <body/>, a <tos-push/> element which contains the <tos/> element of the new terms and an optional <deadline/> element.
The <deadline/> element includes a XMPP Date and Time Profiles (XEP-0082) [4] DateTime value which indicates at which point in time the user must have agreed to the new Terms of Service to be allowed to continue to use the service.
If a user does not agree to an update of the Terms of Service, a service may lock down the account. In this case, authentication is handled as normal. In the post-authentication stream features, the server then MUST include a <tos/> element with a <agreement-required/> child:
<stream:features> ... <tos xmlns='urn:xmpp:tos:0'> <agreement-required/> </tos> </stream:features>
If the <agreement-required/> element is included in the <tos/> stream feature, the client must first agree to the Terms of Service as described in Interact with Terms of Service.
If a client attempts to bind a resource before agreeing to the Terms of Service, the server rejects the request with a <policy-violation/> type 'cancel' error including an application defined condition of <agreement-required> in the namespace of this protocol.
A human readable error MUST be included for legacy clients. The human readable version SHOULD contain a URL to a web page where the user can agree to the Terms of Service without client support.
<iq type='error' id='bind'> <error type='cancel'> <policy-violation xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> <text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas' xml:lang='en'> You need to agree to the current version of the Terms of Service before continuing. </text> <agreement-required xmlns='urn:xmpp:tos:0'/> </error> </iq>
OPTIONAL.
The service SHOULD honor the xml:lang value of the Ad-Hoc Commands (XEP-0050) [1] <command/> in the initial request and choose its translations according to that.
When pushing a notification about a terms of service update, the service SHOULD use the stream-level xml:lang attribute to determine the locale used for the announcement.
This specification allows another type of interaction before authentication. Server implementations MUST ensure that this protocol cannot be abused for pre-authentication attacks (e.g. Denial of Service).
Servers MUST NOT allow entities to query the Terms of Service of another server unless they are authenticated.
REQUIRED.
REQUIRED.
REQUIRED for protocol specifications.
This document in other formats: XML PDF
This XMPP Extension Protocol is copyright © 1999 – 2024 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 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.
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 <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>.
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".
1. XEP-0050: Ad-Hoc Commands <https://xmpp.org/extensions/xep-0050.html>.
2. XEP-0030: Service Discovery <https://xmpp.org/extensions/xep-0030.html>.
3. XEP-0004: Data Forms <https://xmpp.org/extensions/xep-0004.html>.
4. XEP-0082: XMPP Date and Time Profiles <https://xmpp.org/extensions/xep-0082.html>.
Note: Older versions of this specification might be available at https://xmpp.org/extensions/attic/
First draft.
@report{schäfer2018tos, title = {Terms of Services}, author = {Schäfer, Jonas}, type = {XEP}, number = {xxxx}, version = {0.0.1}, institution = {XMPP Standards Foundation}, url = {https://xmpp.org/extensions/xep-xxxx.html}, date = {2018-05-22/2018-05-22}, }
END