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 <http://xmpp.org/extensions/> and announced on the <email@example.com> mailing list.
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:
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:
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:
(exactly once) carries the opaque version identifier of the terms.
(at most once) carries a set of data form field var values which the user has to accept (set to true) in order to use the service.
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:
(at most once) a human-readable title of the document in the language requested by the client.
(at least once) a pair of url and MIME type. The same URL may be given multiple times with different MIME types. Duplicate MIME types MUST NOT occur.
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) )
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:
The client does not include the <tos/> element in its response.
If a server updates its Terms of Service, it may inform its users with a notification. For this, a 'headline' <message/> is used:
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)  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.
4.4 Inform client about Terms of Service expiry after authentication¶
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:
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.
The version of the Terms of Service document as transferred in-band SHOULD NOT be shown to users and MUST be treated as opaque by entities. The version can be used to detect if a version of the document has already been seen by the user and skip displaying it in this case.
The version identifiers generated by servers MUST NOT be longer than 128 characters.
The version identifiers generated by servers MUST be unique for the domain of the server.
Entities MUST NOT compare two version numbers obtained from two different entities.
Servers MAY store notifications about Terms of Service changes in the users server-side archive.
Servers MAY re-send notifications about Terms of Service changes on each login of a client.
Servers SHOULD NOT both re-send notifications about Terms of Service changes on login and store them in the archive.
Servers MAY re-send notifications about Terms of Service changes periodically, but SHOULD NOT re-send them more often than once per day.
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.
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.
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 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".