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.

374 lines

  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. ]>
  6. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  7. <xep>
  8. <header>
  9. <title>Non-SASL Authentication</title>
  10. <abstract>This document specifies a protocol for authentication with Jabber servers and services using the jabber:iq:auth namespace. Note Well: The protocol specified herein has been superseded in favor of SASL authentication as specified in RFC 3920 / RFC 6120, and is now obsolete.</abstract>
  12. <number>0078</number>
  13. <status>Obsolete</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <dependencies>
  17. <spec>XMPP Core</spec>
  18. <spec>RFC 3174</spec>
  19. </dependencies>
  20. <supersedes/>
  21. <supersededby>
  22. <spec>RFC 6120</spec>
  23. </supersededby>
  24. <shortname>iq-auth</shortname>
  25. <schemaloc>
  26. <url></url>
  27. </schemaloc>
  28. &stpeter;
  29. <revision>
  30. <version>2.5</version>
  31. <date>2008-10-29</date>
  32. <initials>psa</initials>
  33. <remark><p>Per a vote of the XMPP Council, changed status to Obsolete.</p></remark>
  34. </revision>
  35. <revision>
  36. <version>2.4</version>
  37. <date>2008-01-30</date>
  38. <initials>psa</initials>
  39. <remark><p>Clarified the reasoning behind adoption of SASL and corrected the security considerations accordingly.</p></remark>
  40. </revision>
  41. <revision>
  42. <version>2.3</version>
  43. <date>2006-09-13</date>
  44. <initials>psa</initials>
  45. <remark><p>Per a vote of the Jabber Council, changed status to Deprecated.</p></remark>
  46. </revision>
  47. <revision>
  48. <version>2.2</version>
  49. <date>2005-06-28</date>
  50. <initials>psa</initials>
  51. <remark><p>Corrected error in schema and example (username is not required in IQ-get).</p></remark>
  52. </revision>
  53. <revision>
  54. <version>2.1</version>
  55. <date>2004-12-09</date>
  56. <initials>psa</initials>
  57. <remark><p>Changed SHOULD to MUST regarding priority of SASL (RFC 3920) over jabber:iq:auth (XEP-0078).</p></remark>
  58. </revision>
  59. <revision>
  60. <version>2.0</version>
  61. <date>2004-10-20</date>
  62. <initials>psa</initials>
  63. <remark><p>Per a vote of the Jabber Council, advanced status to Final.</p></remark>
  64. </revision>
  65. <revision>
  66. <version>1.8</version>
  67. <date>2004-10-18</date>
  68. <initials>psa</initials>
  69. <remark><p>Specified advertising iq-auth stream feature is implementation-specific; clarified several small matters in the text.</p></remark>
  70. </revision>
  71. <revision>
  72. <version>1.7</version>
  73. <date>2004-07-27</date>
  74. <initials>psa</initials>
  75. <remark><p>Added reference to character escaping in digest authentication; required inclusion of stream feature when server supports stream features and it is safe to advertise non-SASL authentication.</p></remark>
  76. </revision>
  77. <revision>
  78. <version>1.6</version>
  79. <date>2004-07-21</date>
  80. <initials>psa</initials>
  81. <remark><p>Removed reference to UTF-16, which is disallowed by XMPP Core; removed reference to character escaping in digest authentication pending list discussion.</p></remark>
  82. </revision>
  83. <revision>
  84. <version>1.5</version>
  85. <date>2004-02-18</date>
  86. <initials>psa</initials>
  87. <remark><p>Added optional stream feature.</p></remark>
  88. </revision>
  89. <revision>
  90. <version>1.4</version>
  91. <date>2004-02-03</date>
  92. <initials>psa</initials>
  93. <remark><p>Clarified that username and resource are required for authentication.</p></remark>
  94. </revision>
  95. <revision>
  96. <version>1.3</version>
  97. <date>2003-11-26</date>
  98. <initials>psa</initials>
  99. <remark><p>Added XMPP error handling.</p></remark>
  100. </revision>
  101. <revision>
  102. <version>1.2</version>
  103. <date>2003-11-06</date>
  104. <initials>psa</initials>
  105. <remark><p>Addressed case of attempting jabber:iq:auth after SASL failure.</p></remark>
  106. </revision>
  107. <revision>
  108. <version>1.1</version>
  109. <date>2003-10-02</date>
  110. <initials>psa</initials>
  111. <remark><p>Moved change password use case to XEP-0077.</p></remark>
  112. </revision>
  113. <revision>
  114. <version>1.0</version>
  115. <date>2003-06-18</date>
  116. <initials>psa</initials>
  117. <remark><p>Per a vote of the Jabber Council, advanced status to Draft.</p></remark>
  118. </revision>
  119. <revision>
  120. <version>0.8</version>
  121. <date>2003-06-18</date>
  122. <initials>psa</initials>
  123. <remark><p>Changes to address Council concerns.</p></remark>
  124. </revision>
  125. <revision>
  126. <version>0.7</version>
  127. <date>2003-06-13</date>
  128. <initials>psa</initials>
  129. <remark><p>Added change password use case; added more details to security considerations.</p></remark>
  130. </revision>
  131. <revision>
  132. <version>0.6</version>
  133. <date>2003-06-12</date>
  134. <initials>psa</initials>
  135. <remark><p>Added digest example; clarified escaping requirements; further specified error conditions; added more details to security considerations.</p></remark>
  136. </revision>
  137. <revision>
  138. <version>0.5</version>
  139. <date>2003-06-06</date>
  140. <initials>psa</initials>
  141. <remark><p>Removed XMPP-style error conditions until formats are stable.</p></remark>
  142. </revision>
  143. <revision>
  144. <version>0.4</version>
  145. <date>2003-05-30</date>
  146. <initials>psa</initials>
  147. <remark><p>Removed "enhanced digest" content, added information about expiration date.</p></remark>
  148. </revision>
  149. <revision>
  150. <version>0.3</version>
  151. <date>2003-05-28</date>
  152. <initials>psa</initials>
  153. <remark><p>Added "enhanced digest" method.</p></remark>
  154. </revision>
  155. <revision>
  156. <version>0.2</version>
  157. <date>2003-05-20</date>
  158. <initials>psa</initials>
  159. <remark><p>Slight editorial revisions.</p></remark>
  160. </revision>
  161. <revision>
  162. <version>0.1</version>
  163. <date>2003-04-10</date>
  164. <initials>psa</initials>
  165. <remark><p>Initial version.</p></remark>
  166. </revision>
  167. </header>
  168. <section1 topic='Introduction' anchor='intro'>
  169. <p><em>Note Well: The protocol specified herein has been superseded in favor of SASL authentication as specified in &rfc3920; and &rfc6120;, and is now obsolete.</em></p>
  170. <p>Jabber technologies have long included a wire protocol that enables a client to authenticate with a server. <note>Component authentication is out of scope for this document, and is specified separately in &xep0114;.</note> The method originally used in the Jabber community makes use of the 'jabber:iq:auth' namespace and has been documented variously in Internet-Drafts and elsewhere. When the core Jabber protocols were formalized by the IETF, the 'jabber:iq:auth' protocol was replaced by the Simple Authentication and Security Layer (SASL) as specified in &rfc4422;. SASL was incorporated into XMPP because it provides a more flexible approach to authentication by enabling XMPP entities to use a wide variety of authentication methods (e.g., PLAIN, DIGEST-MD5, EXTERNAL, and ANONYMOUS), some of which are more secure than the 'jabber:iq:auth' protocol.</p>
  171. <p>The 'jabber:iq:auth' protocol specified herein is now obsolete. However, because it will take some time for existing implementations and deployments to be upgraded to SASL, client and server software implementations still need to include support for 'jabber:iq:auth' in order to interoperate, and this document provides canonical documentation of the 'jabber:iq:auth' protocol. Nevertheless, implementation and deployment of SASL authentication is strongly recommended, since the 'jabber:iq:auth' protocol will eventually be obsoleted entirely.</p>
  172. </section1>
  173. <section1 topic='Requirements' anchor='reqs'>
  174. <p>The 'jabber:iq:auth' namespace must make it possible for a Jabber client to authenticate with a server. In particular, the client must provide a username and appropriate credentials for the specific authentication method used. The methods defined herein are:</p>
  175. <ol>
  176. <li>plaintext</li>
  177. <li>digest (using the SHA1 algorithm specified in &rfc3174;)</li>
  178. </ol>
  179. <p>Note: This document does not include the so-called "zero-knowledge" method; that method did not provide stronger security than digest authentication and thus is unnecessary.</p>
  180. </section1>
  181. <section1 topic='Use Cases' anchor='usecases'>
  182. <section2 topic='User Authenticates with Server' anchor='usecases-auth'>
  183. <p>In order to determine which fields are required for authentication with a server, a client SHOULD first send an IQ get to the server. A client SHOULD NOT attempt to guess at the required fields, since the nature of the required data is subject to service provisioning.</p>
  184. <example caption='Client Requests Authentication Fields from Server'><![CDATA[
  185. <iq type='get' to='shakespeare.lit' id='auth1'>
  186. <query xmlns='jabber:iq:auth'/>
  187. </iq>
  188. ]]></example>
  189. <example caption='Server Returns Authentication Fields to Client'><![CDATA[
  190. <iq type='result' id='auth1'>
  191. <query xmlns='jabber:iq:auth'>
  192. <username/>
  193. <password/>
  194. <digest/>
  195. <resource/>
  196. </query>
  197. </iq>
  198. ]]></example>
  199. <p>If the client included a username with the IQ-get but there is no such username, the server SHOULD NOT return an error, but instead SHOULD return the normal authentication fields (this helps to prevent unknown users from discovering which usernames are in use). If the server does not support non-SASL authentication (e.g., because it supports only SASL authentication as defined in <cite>RFC 6120</cite>), it MUST return a &unavailable; error. If the client previously attempted SASL authentication but that attempt failed, the server MUST return a &lt;policy-violation/&gt; stream error (see <cite>RFC 6120</cite> regarding stream error syntax).</p>
  200. <p>Both the username and the resource are REQUIRED for client authentication using the 'jabber:iq:auth' namespace; if more flexible authentication and resource provisioning are desired, a server SHOULD implement SASL authentication and resource binding as defined in <cite>RFC 6120</cite> (e.g., to enable the server to provide the resource). The &lt;username/&gt; and &lt;resource/&gt; elements MUST be included in the IQ result returned by the server in response to the initial IQ get, and also MUST be included in the IQ set sent by the client when providing authentication credentials.</p>
  201. <p>The foregoing stanza shows that the server supports both plaintext authentication (via the &lt;password/&gt; element) and digest authentication with SHA1-encrypted passwords (via the &lt;digest/&gt; element).</p>
  202. <p>Therefore, in order to successfully authenticate with the server in this example, a client MUST provide a username, a resource, and one of password or digest.</p>
  203. <example caption='Client Provides Required Information (Plaintext)'><![CDATA[
  204. <iq type='set' id='auth2'>
  205. <query xmlns='jabber:iq:auth'>
  206. <username>bill</username>
  207. <password>Calli0pe</password>
  208. <resource>globe</resource>
  209. </query>
  210. </iq>
  211. ]]></example>
  212. <p>Plaintext passwords are straightforward (obviously, characters that map to predefined XML entities MUST be escaped according to the rules defined in section 4.6 of the XML specification, and any non-US-ASCII characters MUST be encoded according to the encoding of XML streams as specified in <cite>RFC 6120</cite>, i.e., UTF-8 as defined in &rfc3629;).</p>
  213. <p>The value of the &lt;digest/&gt; element MUST be computed according to the following algorithm:</p>
  214. <ol>
  215. <li>Concatenate the Stream ID received from the server with the password. <note>In Digest authentication, password characters that map to predefined XML entities SHOULD NOT be escaped as they are for plaintext passwords, but non-US-ASCII characters MUST be encoded as UTF-8 since the SHA-1 hashing algorithm operates on byte arrays.</note></li>
  216. <li>Hash the concatenated string according to the SHA1 algorithm, i.e., SHA1(concat(sid, password)).</li>
  217. <li>Ensure that the hash output is in hexidecimal format, not binary or base64.</li>
  218. <li>Convert the hash output to all lowercase characters.</li>
  219. </ol>
  220. <example caption='Client Provides Required Information (Digest)'><![CDATA[
  221. <iq type='set' id='auth2'>
  222. <query xmlns='jabber:iq:auth'>
  223. <username>bill</username>
  224. <digest>48fc78be9ec8f86d8ce1c39c320c97c21d62334d</digest>
  225. <resource>globe</resource>
  226. </query>
  227. </iq>
  228. ]]></example>
  229. <p>The character data shown in the &lt;digest/&gt; element is the output produced as a result of following the algorithm defined above when the stream ID is '3EE948B0' and the password is 'Calli0pe'.</p>
  230. <p>If the credentials provided match those known by the server, the client will be successfully authenticated.</p>
  231. <example caption='Server Informs Client of Successful Authentication'><![CDATA[
  232. <iq type='result' id='auth2'/>
  233. ]]></example>
  234. <p>Alternatively, authentication may fail. Possible causes of failure include:</p>
  235. <ol>
  236. <li>The user provided incorrect credentials.</li>
  237. <li>There is a resource conflict (i.e., there is already an active session with that resource identifier associated with the same username). The RECOMMENDED behavior is for the server to terminate the existing session and create the new one; however, the server MAY provide the opposite behavior if desired, leading to a conflict error for the newly requested login.</li>
  238. <li>The user did not provide all of the required information (e.g., did not provide a username or resource).</li>
  239. </ol>
  240. <p>Although <cite>RFC 6120</cite> specifies that error stanzas SHOULD include the original XML sent, error stanzas qualified by the 'jabber:iq:auth' namespace SHOULD NOT do so given the sensitive nature of the information being exchanged.</p>
  241. <example caption='Server Informs Client of Failed Authentication (Incorrect Credentials)'><![CDATA[
  242. <iq type='error' id='auth2'>
  243. <error code='401' type='auth'>
  244. <not-authorized xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  245. </error>
  246. </iq>
  247. ]]></example>
  248. <example caption='Server Informs Client of Failed Authentication (Resource Conflict)'><![CDATA[
  249. <iq type='error' id='auth2'>
  250. <error code='409' type='cancel'>
  251. <conflict xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  252. </error>
  253. </iq>
  254. ]]></example>
  255. <example caption='Server Informs Client of Failed Authentication (Required Information Not Provided)'><![CDATA[
  256. <iq type='error' id='auth2'>
  257. <error code='406' type='modify'>
  258. <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  259. </error>
  260. </iq>
  261. ]]></example>
  262. </section2>
  263. </section1>
  264. <section1 topic='Stream Feature' anchor='streamfeature'>
  265. <p><cite>RFC 6120</cite> defines methods for advertising feature support during stream negotiation. It may be desirable for a server to advertise support for non-SASL authentication as a stream feature. The namespace for reporting support within &lt;stream:features/&gt; is "". Upon receiving a stream header qualified by the 'jabber:client' namespace, a server that returns stream features SHOULD also announce support for non-SASL authentication by including the relevant stream feature. Exactly when a server advertises the iq-auth stream feature is up to the implementation or deployment (e.g., a server MAY advertise this feature only after successful TLS negotiation or if the channel is encrypted via the older SSL method). Obviously, this does not apply to servers that do not support stream features (e.g., older servers that do not comply with XMPP 1.0).</p>
  266. <example caption='Advertising non-SASL authentication as a stream feature'><![CDATA[
  267. <stream:features>
  268. <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
  269. <mechanism>DIGEST-MD5</mechanism>
  270. <mechanism>PLAIN</mechanism>
  271. </mechanisms>
  272. <auth xmlns=''/>
  273. </stream:features>
  274. ]]></example>
  275. <p>A server SHOULD NOT advertise non-SASL authentication to another server (i.e., if the initial stream header was qualified by the 'jabber:server' namespace).</p>
  276. </section1>
  277. <section1 topic='Error Handling' anchor='errors'>
  278. <p>As defined herein, the 'jabber:iq:auth' namespace supports both the old (HTTP-style) error codes and the extensible error classes and conditions specified in <cite>RFC 6120</cite>. A compliant server or service implementation MUST support both old-style and new-style error handling. A compliant client implementation SHOULD support both.</p>
  279. </section1>
  280. <section1 topic='Expiration Date' anchor='expiration'>
  281. <p>In accordance with Section 8 of &xep0001;, on 2004-10-20 this document was advanced to a status of Final with the understanding that it would expire in six months. On 2006-09-13, the Jabber Council (now XMPP Council) changed the status of this document to Deprecated. The Jabber Council will review this document every six months to determine whether to change its status to Obsolete or to extend the expiration date for an additional six months; this process will continue until the document is obsoleted. For the latest expiration date, refer to the XEP Information block at the beginning of this document.</p>
  282. </section1>
  283. <section1 topic='Security Considerations' anchor='security'>
  284. <p>Use of SASL authentication can be more secure than the 'jabber:iq:auth' protocol, depending on which SASL mechanism is used. Because SASL provides greater flexibility and can provide stronger security, the 'jabber:iq:auth' protocol is now obsolete. If both client and server implement SASL, they MUST prefer SASL over the 'jabber:iq:auth' protocol. If a client attempts to authenticate using the 'jabber:iq:auth' namespace after an attempt at SASL authentication fails, the server MUST refuse the 'jabber:iq:auth' attempt by returning a &lt;policy-violation/&gt; stream error to the client.</p>
  285. <p>Client implementations MUST NOT make plaintext the default mechanism, and SHOULD warn the user that the plaintext mechanism is insecure. The plaintext mechanism SHOULD NOT be used unless the underlying stream is encrypted (using SSL or TLS) and the client has verified that the server certificate is signed by a trusted certification authority. A given domain MAY choose to disable plaintext logins if the stream is not properly encrypted, or disable them entirely. If a client implements the plaintext mechanism and a server allows both the digest mechanism and the plaintext mechanism when channel encryption is not in use, a downgrade attack is possible, in which a man-in-the-middle tricks the client into revealing the user's plaintext password.</p>
  286. </section1>
  287. <section1 topic='IANA Considerations' anchor='iana'>
  288. <p>This document requires no interaction with &IANA;.</p>
  289. </section1>
  290. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  291. <section2 topic='Protocol Namespaces' anchor='registrar-ns'>
  292. <p>The &REGISTRAR; includes the 'jabber:iq:auth' namespace in its registry of protocol namespaces.</p>
  293. </section2>
  294. <section2 topic='Stream Features' anchor='registrar-stream'>
  295. <p>The XMPP Registrar includes the '' namespace in its registry of stream feature namespaces.</p>
  296. </section2>
  297. </section1>
  298. <section1 topic='XML Schemas' anchor='schemas'>
  299. <section2 topic='jabber:iq:auth' anchor='schemas-auth'>
  300. <code><![CDATA[
  301. <?xml version='1.0' encoding='UTF-8'?>
  302. <xs:schema
  303. xmlns:xs=''
  304. targetNamespace='jabber:iq:auth'
  305. xmlns='jabber:iq:auth'
  306. elementFormDefault='qualified'>
  307. <xs:annotation>
  308. <xs:documentation>
  309. NOTE WELL: Non-SASL Authentication via the jabber:iq:auth
  310. protocol has been superseded by SASL Authentication as
  311. defined in RFC 3920 and RFC 6120, and is now obsolete.
  312. For historical purposes, the protocol documented by this
  313. schema is defined in XEP-0078:
  315. </xs:documentation>
  316. </xs:annotation>
  317. <xs:element name='query'>
  318. <xs:complexType>
  319. <xs:sequence>
  320. <xs:element name='username' type='xs:string' minOccurs='0'/>
  321. <xs:choice>
  322. <xs:element name='password' type='xs:string' minOccurs='0'/>
  323. <xs:element name='digest' type='xs:string' minOccurs='0'/>
  324. </xs:choice>
  325. <xs:element name='resource' type='xs:string' minOccurs='0'/>
  326. </xs:sequence>
  327. </xs:complexType>
  328. </xs:element>
  329. </xs:schema>
  330. ]]></code>
  331. </section2>
  332. <section2 topic='Stream Feature' anchor='schemas-stream'>
  333. <code><![CDATA[
  334. <?xml version='1.0' encoding='UTF-8'?>
  335. <xs:schema
  336. xmlns:xs=''
  337. targetNamespace=''
  338. xmlns=''
  339. elementFormDefault='qualified'>
  340. <xs:annotation>
  341. <xs:documentation>
  342. NOTE WELL: Non-SASL Authentication via the jabber:iq:auth
  343. protocol has been superseded by SASL Authentication as
  344. defined in RFC 3920 and RFC 6120, and is now obsolete.
  345. For historical purposes, the protocol documented by this
  346. schema is defined in XEP-0078:
  348. </xs:documentation>
  349. </xs:annotation>
  350. <xs:element name='auth' type='empty'/>
  351. <xs:simpleType name='empty'>
  352. <xs:restriction base='xs:string'>
  353. <xs:enumeration value=''/>
  354. </xs:restriction>
  355. </xs:simpleType>
  356. </xs:schema>
  357. ]]></code>
  358. </section2>
  359. </section1>
  360. </xep>