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-0100.xml 50KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026
  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>Gateway Interaction</title>
  10. <abstract>This document specifies best practices for interactions between Jabber clients and client proxy gateways to legacy IM services.</abstract>
  11. &LEGALNOTICE;
  12. <number>0100</number>
  13. <status>Active</status>
  14. <type>Informational</type>
  15. <sig>Standards</sig>
  16. <dependencies>
  17. <spec>XMPP Core</spec>
  18. <spec>XMPP IM</spec>
  19. <spec>XEP-0030</spec>
  20. <spec>XEP-0077</spec>
  21. <spec>XEP-0144</spec>
  22. </dependencies>
  23. <supersedes/>
  24. <supersededby/>
  25. <shortname>gateway</shortname>
  26. <schemaloc>
  27. <url>http://www.xmpp.org/schemas/iq-gateway.xsd</url>
  28. </schemaloc>
  29. &stpeter;
  30. &dizzyd;
  31. <revision>
  32. <version>1.0</version>
  33. <date>2005-10-05</date>
  34. <initials>psa</initials>
  35. <remark>Per a vote of the Jabber Council, advanced status to Active.</remark>
  36. </revision>
  37. <revision>
  38. <version>0.10</version>
  39. <date>2005-05-12</date>
  40. <initials>psa</initials>
  41. <remark>Modified text regarding address transformations and added reference to XEP-0106; corrected several small errors in the text and examples.</remark>
  42. </revision>
  43. <revision>
  44. <version>0.9</version>
  45. <date>2004-10-27</date>
  46. <initials>psa</initials>
  47. <remark>Added specification of jabber:iq:gateway namespace; added reference to XEP-0144.</remark>
  48. </revision>
  49. <revision>
  50. <version>0.8</version>
  51. <date>2004-05-07</date>
  52. <initials>psa</initials>
  53. <remark>Editorial review: made a number of minor textual changes and clarifications throughout; added introductory paragraph to each use case; specified that groupchat is out of scope.</remark>
  54. </revision>
  55. <revision>
  56. <version>0.7</version>
  57. <date>2004-03-31</date>
  58. <initials>psa</initials>
  59. <remark>Cleaned up several notes, examples, and business rules based on feedback received on list.</remark>
  60. </revision>
  61. <revision>
  62. <version>0.6</version>
  63. <date>2004-03-08</date>
  64. <initials>psa</initials>
  65. <remark>Added note about 'from' address on presence notifications and messages received through gateways from legacy users.</remark>
  66. </revision>
  67. <revision>
  68. <version>0.5</version>
  69. <date>2004-01-21</date>
  70. <initials>psa</initials>
  71. <remark>Further specified the rationale for deprecating the "jabber:iq:gateway" protocol.</remark>
  72. </revision>
  73. <revision>
  74. <version>0.4</version>
  75. <date>2004-01-05</date>
  76. <initials>psa</initials>
  77. <remark>Added Edit Registration use case; modified handling of legacy contact lists to conform to RFC 3921; modified addressing rules; defined gateway startup and shutdown behavior; included XMPP error handling.</remark>
  78. </revision>
  79. <revision>
  80. <version>0.3</version>
  81. <date>2003-12-10</date>
  82. <initials>psa</initials>
  83. <remark>Added security considerations; defined handling of legacy contact lists.</remark>
  84. </revision>
  85. <revision>
  86. <version>0.2</version>
  87. <date>2003-12-03</date>
  88. <initials>psa</initials>
  89. <remark>Corrected some errors; clarified some ambiguities; added protocol flows.</remark>
  90. </revision>
  91. <revision>
  92. <version>0.1</version>
  93. <date>2003-06-25</date>
  94. <initials>psa/dss</initials>
  95. <remark>Initial version.</remark>
  96. </revision>
  97. </header>
  98. <section1 topic='Introduction' anchor='intro'>
  99. <p>One distinguishing characteristic of Jabber technologies from their earliest days has been the existence of gateways (also called "transports") between the Jabber network and legacy instant messaging services such as AOL Instant Messenger (AIM), ICQ, Windows Live Messenger, and Yahoo! Messenger. Surprisingly, the recommended behavior of such gateways, including the protocol elements used by a client to interact with a gateway, has never been fully documented. This document attempts to fill that void by codifying best practices for gateway interaction.</p>
  100. <p>Note well that this document defines protocol usage with regard to client proxy gateways, i.e., gateways that "masquerade" as a client on a non-Jabber IM service. Gateways that perform direct protocol translation without proxying for an account on a non-Jabber service are not addressed in this document. Furthermore, this document does not define any interaction between a gateway and the non-Jabber service, only interactions between a Jabber client and the gateway. Although what happens on the other side of the gateway is highly dependent on the nature of the legacy service, gateways should at least provide a common interface on the Jabber side of the gateway so that Jabber clients can be written in a consistent fashion.</p>
  101. </section1>
  102. <section1 topic='Glossary' anchor='glossary'>
  103. <dl>
  104. <di>
  105. <dt>Gateway</dt>
  106. <dd>A service on the Jabber network that translates between the Jabber/XMPP protocols and the protocol used by a Legacy Service; in the context of this document, by "gateway" we mean a "client proxy service" that acts as a client with regard to a Legacy Service and thereby "masquerades" as a user on such a service.</dd>
  107. </di>
  108. <di>
  109. <dt>Jabber User</dt>
  110. <dd>A human user who has registered an account with a Jabber server; a Jabber User who wants to use a Gateway must first have also registered an account with a Legacy Service.</dd>
  111. </di>
  112. <di>
  113. <dt>Legacy Service</dt>
  114. <dd>A non-XMPP instant messaging service.</dd>
  115. </di>
  116. <di>
  117. <dt>Legacy User</dt>
  118. <dd>A human user who has registered an account with a Legacy Service.</dd>
  119. </di>
  120. <di>
  121. <dt>Server</dt>
  122. <dd>An instant messaging server as defined in <cite>RFC 6121</cite>.</dd>
  123. </di>
  124. </dl>
  125. </section1>
  126. <section1 topic='Requirements' anchor='reqs'>
  127. <p>The requirements defined by this document are captured in two sets of use cases: one set from the perspective of the Jabber User, and a smaller set from the perspective of the Legacy User who wants to interact with the Jabber User.</p>
  128. <p>The Jabber User use cases are:</p>
  129. <ol>
  130. <li>Register</li>
  131. <li>Edit Registration</li>
  132. <li>Unregister</li>
  133. <li>Log In</li>
  134. <li>Log Out</li>
  135. <li>Add Contact</li>
  136. <li>Delete Contact</li>
  137. <li>Send Message</li>
  138. </ol>
  139. <p>The Legacy User use cases are:</p>
  140. <ol>
  141. <li>Add Contact</li>
  142. <li>Delete Contact</li>
  143. <li>Send Message</li>
  144. </ol>
  145. <p>While more advanced use cases (e.g., sending files and joining chat rooms) are of inherent interest, they are not covered in this document because registration, contact list management, and message exchange define the baseline functionality included in all gateway implementations; future specifications may address the more advanced use cases.</p>
  146. </section1>
  147. <section1 topic='Jabber User Use Cases' anchor='usecases-jabber'>
  148. <section2 topic='Register' anchor='usecases-jabber-register'>
  149. <p>All existing client proxy gateways require a Jabber User to register with the Gateway before sending messages or presence through the gateway. Although strictly speaking registration is not required (e.g., a Gateway could prompt the Jabber User for credentials every time the user attempted to communicate through the gateway, or once per "session"), in practice this step is required.</p>
  150. <section3 topic='Primary Flow' anchor='usecases-jabber-register-pri'>
  151. <ol>
  152. <li>
  153. <p>Jabber User sends IQ-get qualified by the &xep0030; information namespace to the Gateway, and/or IQ-get qualified by the &xep0094; namespace to the Gateway's parent (the latter method is deprecated but still in use).</p>
  154. <example caption="User Queries Gateway Regarding Service Discovery Identity"><![CDATA[
  155. <iq type='get'
  156. from='romeo@montague.lit/orchard'
  157. to='aim.shakespeare.lit'
  158. id='disco1'>
  159. <query xmlns='http://jabber.org/protocol/disco#info'/>
  160. </iq>
  161. ]]></example>
  162. <example caption="User Queries Gateway's Parent Regarding Agent Information"><![CDATA[
  163. <iq type='get'
  164. from='romeo@montague.lit/orchard'
  165. to='shakespeare.lit'
  166. id='agent1'>
  167. <query xmlns='jabber:iq:agents'/>
  168. </iq>
  169. ]]></example>
  170. <p>Note: Although many existing gateway implementations support only the older Agent Information protocol, it is RECOMMENDED that gateways support the Service Discovery protocol, since the former protocol is deprecated in favor of the latter. Until existing gateways are upgraded, clients SHOULD support both.</p>
  171. </li>
  172. <li>
  173. <p>Gateway and/or parent returns identity information to Jabber User's Client.</p>
  174. <example caption="Gateway Returns Service Discovery Identity"><![CDATA[
  175. <iq type='result'
  176. from='aim.shakespeare.lit'
  177. to='romeo@montague.lit/orchard'
  178. id='disco1'>
  179. <query xmlns='http://jabber.org/protocol/disco#info'>
  180. <identity category='gateway'
  181. type='aim'
  182. name='AIM Gateway'/>
  183. <feature var='http://jabber.org/protocol/disco#info'/>
  184. <feature var='jabber:iq:register'/>
  185. <feature var='jabber:iq:time'/>
  186. <feature var='jabber:iq:version'/>
  187. </query>
  188. </iq>
  189. ]]></example>
  190. <example caption="Gateway's Parent Returns Agent Information"><![CDATA[
  191. <iq type='result'
  192. from='romeo@montague.lit/orchard'
  193. to='shakespeare.lit'
  194. id='agent1'>
  195. <query xmlns='jabber:iq:agents'>
  196. <agent jid='aim.shakespeare.lit'>
  197. <name>AIM Gateway</name>
  198. <service>aim</service>
  199. <transport/>
  200. <register/>
  201. </agent>
  202. </query>
  203. </iq>
  204. ]]></example>
  205. <p>Note: Given the foregoing, a client can determine the identity of the gateway, specifically (1) that it is a gateway and (2) to which legacy service it provides a gateway.</p>
  206. </li>
  207. <li>
  208. <p>Jabber User sends IQ-get qualified by the &xep0077; (jabber:iq:register) namespace to Gateway.</p>
  209. <example caption="User Queries Gateway Regarding Registration Requirements"><![CDATA[
  210. <iq type='get'
  211. from='romeo@montague.lit/orchard'
  212. to='aim.shakespeare.lit'
  213. id='reg1'>
  214. <query xmlns='jabber:iq:register'/>
  215. </iq>
  216. ]]></example>
  217. </li>
  218. <li>
  219. <p>Gateway returns IQ-result to Jabber User, specifying information that is required in order to register.</p>
  220. <example caption="Gateway Returns Registration Requirements"><![CDATA[
  221. <iq type='result'
  222. from='aim.shakespeare.lit'
  223. to='romeo@montague.lit/orchard'
  224. id='reg1'>
  225. <query xmlns='jabber:iq:register'>
  226. <instructions>
  227. Please provide your AIM screen name and password.
  228. </instructions>
  229. <username/>
  230. <password/>
  231. </query>
  232. </iq>
  233. ]]></example>
  234. </li>
  235. <li>
  236. <p>Jabber User sends IQ-set qualified by the 'jabber:iq:register' namespace to Gateway, containing information required to register.</p>
  237. <example caption="User Provides Registration Information"><![CDATA[
  238. <iq type='set'
  239. from='romeo@montague.lit/orchard'
  240. to='aim.shakespeare.lit'
  241. id='reg2'>
  242. <query xmlns='jabber:iq:register'>
  243. <username>RomeoMyRomeo</username>
  244. <password>ILoveJuliet</password>
  245. </query>
  246. </iq>
  247. ]]></example>
  248. <p>Note: The XML character data of the &lt;username/&gt; element SHOULD be the Jabber User's LegacyUserAddress as described under <link url='#addressing'>Addressing</link>, such as an AOL screen name, ICQ number, Windows Live Messenger (formerly MSN Messenger) address, or Yahoo! ID.</p>
  249. </li>
  250. <li>
  251. <p>Gateway verifies that registration information provided by Jabber User is valid (using whatever means appropriate for the Legacy Service) and informs Jabber User of success [A1].</p>
  252. <example caption="Gateway Informs Jabber User of Success"><![CDATA[
  253. <iq type='result'
  254. from='aim.shakespeare.lit'
  255. to='romeo@montague.lit/orchard'
  256. id='reg2'/>
  257. ]]></example>
  258. </li>
  259. <li><p>If Gateway logged into Legacy Service in preceding step, Gateway buffers any translatable events (e.g., messages and presence) queued up for Jabber User on Legacy Service.</p></li>
  260. <li>
  261. <p>Optionally, Jabber User sends IQ-set qualified by the 'jabber:iq:roster' namespace to its server (see &xmppcore;), containing a roster item for Gateway.</p>
  262. <example caption="User Creates Roster Entry"><![CDATA[
  263. <iq type='set'
  264. from='romeo@montague.lit/orchard'
  265. id='roster1'>
  266. <query xmlns='jabber:iq:roster'>
  267. <item jid='aim.shakespeare.lit' name='AIM Gateway'/>
  268. </query>
  269. </iq>
  270. ]]></example>
  271. <example caption="Server Response"><![CDATA[
  272. <iq type='result'
  273. to='romeo@montague.lit/orchard'
  274. id='roster1'/>
  275. ]]></example>
  276. </li>
  277. <li>
  278. <p>Gateway sends subscription request to Jabber User (i.e., by sending a presence stanza of type "subscribe" to Jabber User's bare JID).</p>
  279. <example caption="Gateway Subscribes to User's Presence"><![CDATA[
  280. <presence type='subscribe'
  281. from='aim.shakespeare.lit'
  282. to='romeo@montague.lit'/>
  283. ]]></example>
  284. </li>
  285. <li>
  286. <p>Jabber User's client SHOULD approve the subscription request (i.e., by sending a presence stanza of type "subscribed" to Gateway).</p>
  287. <example caption="Jabber User Approves Subscription Request"><![CDATA[
  288. <presence type='subscribed'
  289. from='romeo@montague.lit'
  290. to='aim.shakespeare.lit'/>
  291. ]]></example>
  292. <p>Note: As specified in <cite>RFC 6121</cite>, Jabber User's server will generate a "roster push" at this point if client did not previously perform a roster set to add Gateway to user's roster (as mentioned above).</p>
  293. </li>
  294. <li>
  295. <p>Jabber User sends subscription request to Gateway (i.e., by sending a presence stanza of type "subscribe" to Gateway).</p>
  296. <example caption="Jabber User Subscribes to Gateway&apos;s Presence"><![CDATA[
  297. <presence type='subscribe'
  298. from='romeo@montague.lit'
  299. to='aim.shakespeare.lit'/>
  300. ]]></example>
  301. </li>
  302. <li>
  303. <p>Gateway sends approves subscription request (i.e., by sending a presence stanza of type "subscribed" to Jabber User's bare JID).</p>
  304. <example caption="Gateway Approves Subscription Request"><![CDATA[
  305. <presence type='subscribed'
  306. from='aim.shakespeare.lit'
  307. to='romeo@montague.lit'/>
  308. ]]></example>
  309. </li>
  310. <li><p>Execute "Log In" use case.</p></li>
  311. <li><p>Gateway sends any buffered messages to Jabber User.</p></li>
  312. <li><p>Use Case Ends.</p></li>
  313. </ol>
  314. </section3>
  315. <section3 topic='Alternate Flows' anchor='usecases-jabber-register-alt'>
  316. <ol>
  317. <li><p>User information not verified:</p>
  318. <ol>
  319. <li>
  320. <p>Gateway returns &notacceptable; error to Jabber User. (For detailed information regarding error conditions, refer to &xep0086;.)</p>
  321. <example caption="Gateway Informs Jabber User of Registration Error"><![CDATA[
  322. <iq type='error'
  323. from='aim.shakespeare.lit'
  324. to='romeo@montague.lit/orchard'
  325. id='reg2'>
  326. <query xmlns='jabber:iq:register'>
  327. <username>RomeoMyRomeo</username>
  328. <password>ILoveJuliet</password>
  329. </query>
  330. <error code='406' type='modify'>
  331. <not-acceptable
  332. xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  333. </error>
  334. </iq>
  335. ]]></example>
  336. </li>
  337. <li><p>Use Case Ends unsuccessfully.</p></li>
  338. </ol>
  339. </li>
  340. </ol>
  341. </section3>
  342. </section2>
  343. <section2 topic='Edit Registration' anchor='usecases-jabber-edit'>
  344. <p>After a Jabber User has registered with a Gateway, the user may wish to modify his or her existing registration information (e.g., because the user has changed his or her password on the legacy IM service).</p>
  345. <section3 topic='Primary Flow' anchor='usecases-jabber-edit-pri'>
  346. <ol>
  347. <li>
  348. <p>Jabber User sends IQ-get qualified by the 'jabber:iq:register' namespace to Gateway.</p>
  349. <example caption="User Queries Gateway Regarding Registration Requirements"><![CDATA[
  350. <iq type='get'
  351. from='romeo@montague.lit/orchard'
  352. to='aim.shakespeare.lit'
  353. id='edit1'>
  354. <query xmlns='jabber:iq:register'/>
  355. </iq>
  356. ]]></example>
  357. </li>
  358. <li>
  359. <p>Gateway returns IQ-result to Jabber User, specifying registration information on record and including empty &lt;registered/&gt; element to signify that user is already registered. <note>The fact that the Gateway can determine the Jabber User's legacy username based on the JID of the 'from' address indicates that the client proxy model assumes one registration per Jabber User.</note></p>
  360. <example caption="Gateway Returns Registration Information of Record"><![CDATA[
  361. <iq type='result'
  362. from='aim.shakespeare.lit'
  363. to='romeo@montague.lit/orchard'
  364. id='edit1'>
  365. <query xmlns='jabber:iq:register'>
  366. <registered/>
  367. <username>RomeoMyRomeo</username>
  368. <password>ILoveJuliet</password>
  369. </query>
  370. </iq>
  371. ]]></example>
  372. </li>
  373. <li>
  374. <p>Jabber User sends IQ-set qualified by the 'jabber:iq:register' namespace to Gateway, containing all information (i.e., not just the "delta").</p>
  375. <example caption="User Provides Registration Information"><![CDATA[
  376. <iq type='set'
  377. from='romeo@montague.lit/orchard'
  378. to='aim.shakespeare.lit'
  379. id='edit2'>
  380. <query xmlns='jabber:iq:register'>
  381. <username>RomeoMyRomeo</username>
  382. <password>B4lc0ny</password>
  383. </query>
  384. </iq>
  385. ]]></example>
  386. </li>
  387. <li>
  388. <p>Gateway verifies that, if changed, information provided by Jabber User is still valid (using whatever means appropriate for the Legacy Service) and informs Jabber User of success [A1].</p>
  389. <example caption="Gateway Informs Jabber User of Success"><![CDATA[
  390. <iq type='result'
  391. from='aim.shakespeare.lit'
  392. to='romeo@montague.lit/orchard'
  393. id='edit2'/>
  394. ]]></example>
  395. </li>
  396. </ol>
  397. </section3>
  398. <section3 topic='Alternate Flows' anchor='usecases-jabber-edit-alt'>
  399. <ol>
  400. <li><p>Edit unsuccessful:</p>
  401. <ol>
  402. <li>
  403. <p>Gateway returns &notacceptable; error to Jabber User.</p>
  404. <example caption="Gateway Informs Jabber User of Registration Error"><![CDATA[
  405. <iq type='error'
  406. from='aim.shakespeare.lit'
  407. to='romeo@montague.lit/orchard'
  408. id='edit2'>
  409. <query xmlns='jabber:iq:register'>
  410. <username>RomeoMyRomeo</username>
  411. <password>B4lc0ny</password>
  412. </query>
  413. <error code='406' type='modify'>
  414. <not-acceptable
  415. xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  416. </error>
  417. </iq>
  418. ]]></example>
  419. </li>
  420. <li><p>Use Case Ends unsuccessfully.</p></li>
  421. </ol>
  422. </li>
  423. </ol>
  424. </section3>
  425. </section2>
  426. <section2 topic='Unregister' anchor='usecases-jabber-unregister'>
  427. <p>After a Jabber User has registered with a Gateway, the user may choose to unregister with the Gateway, effectively ending his or her relationship with the Gateway (e.g., the user will no longer be allowed to communicate through the gateway with legacy users).</p>
  428. <section3 topic='Primary Flow' anchor='usecases-jabber-unregister-pri'>
  429. <ol>
  430. <li>
  431. <p>Jabber User sends IQ-set in 'jabber:iq:register' namespace to Gateway, containing empty &lt;remove/&gt; element.</p>
  432. <example caption="User Unregisters"><![CDATA[
  433. <iq type='set'
  434. from='romeo@montague.lit/orchard'
  435. to='aim.shakespeare.lit'
  436. id='unreg1'>
  437. <query xmlns='jabber:iq:register'>
  438. <remove/>
  439. </query>
  440. </iq>
  441. ]]></example>
  442. </li>
  443. <li><p>Gateway sends unavailable presence from Jabber User to Legacy Users and logs Jabber User out of Legacy Service.</p></li>
  444. <li><p>Gateway deletes Jabber User's information.</p></li>
  445. <li>
  446. <p>Gateway sends IQ-result to Jabber User.</p>
  447. <example caption="Gateway Informs Jabber User of Success"><![CDATA[
  448. <iq type='result'
  449. from='aim.shakespeare.lit'
  450. to='romeo@montague.lit/orchard'
  451. id='unreg1'/>
  452. ]]></example>
  453. </li>
  454. <li>
  455. <p>Gateway cancels subscriptions.</p>
  456. <example caption="Gateway Cancels Subscriptions"><![CDATA[
  457. <presence type='unsubscribe'
  458. from='aim.shakespeare.lit'
  459. to='romeo@montague.lit'/>
  460. <presence type='unsubscribed'
  461. from='aim.shakespeare.lit'
  462. to='romeo@montague.lit'/>
  463. ]]></example>
  464. </li>
  465. <li>
  466. <p>Gateway sends unavailable presence to Jabber User.</p>
  467. <example caption="Gateway Logs User Out"><![CDATA[
  468. <presence type='unavailable'
  469. from='aim.shakespeare.lit'
  470. to='romeo@montague.lit'/>
  471. ]]></example>
  472. </li>
  473. <li><p>Jabber User's client SHOULD delete from the user's roster (1) the gateway itself, and (2) all legacy Contacts associated with the gateway.</p></li>
  474. <li><p>Use Case Ends.</p></li>
  475. </ol>
  476. </section3>
  477. <section3 topic='Alternate Flows' anchor='usecases-jabber-unregister-alt'>
  478. <p>None.</p>
  479. </section3>
  480. </section2>
  481. <section2 topic='Log In' anchor='usecases-jabber-login'>
  482. <p>After a Jabber User has registered with a Gateway, the Jabber User may subsequently log in to the Gateway, effectively creating a "session" with the Gateway and enabling the Gateway to log into the Legacy Service on behalf of the user by sending the user's legacy credentials to the Legacy Service.</p>
  483. <section3 topic='Primary Flow' anchor='usecases-jabber-login-pri'>
  484. <ol>
  485. <li>
  486. <p>Jabber User sends available presence broadcast to Server or sends directed presence to Gateway or a Legacy User.</p>
  487. <example caption="Jabber User Sends Available Presence"><![CDATA[
  488. <presence/>
  489. ]]></example>
  490. <example caption="Jabber User's Server Broadcasts Available Presence"><![CDATA[
  491. <presence from='romeo@montague.lit/orchard'
  492. to='juliet@aim.shakespeare.lit'/>
  493. <presence from='romeo@montague.lit/orchard'
  494. to='aim.shakespeare.lit'/>
  495. ...
  496. ]]></example>
  497. </li>
  498. <li><p>Upon receiving the first presence notification stanza from Jabber User to Gateway or Legacy User, Gateway logs Jabber User into Legacy Service [A1].</p></li>
  499. <li>
  500. <p>Gateway sends presence stanza to Jabber User expressing availability.</p>
  501. <example caption="Gateway Sends Presence to Jabber User"><![CDATA[
  502. <presence from='aim.shakespeare.lit'
  503. to='romeo@montague.lit'/>
  504. ]]></example>
  505. </li>
  506. <li><p>Optionally, Gateway handles Legacy Service contact list; see the <link url="#rosters">Contact Lists</link> section of this document.</p></li>
  507. <li>
  508. <p>Gateway forwards current presence information from Legacy Users to Jabber User, if possible mapping availability status (e.g., "away").</p>
  509. <example caption="Gateway Sends Presence from Legacy Users to Jabber User"><![CDATA[
  510. <presence from='juliet@aim.shakespeare.lit'
  511. to='romeo@montague.lit'>
  512. <show>away</show>
  513. </presence>
  514. ]]></example>
  515. <p>Note: If the Legacy Service to which the Gateway connects does not support the concept of "resources", the 'from' address of presence notification stanzas generated by a gateway SHOULD NOT include a resource identifier (i.e., they SHOULD be of the form &lt;user@host&gt; rather than &lt;user@host/resource&gt;). However, the 'from' address MAY include a resource if the Gateway determines that this is appropriate in the context of its communications with the Legacy Service.</p>
  516. </li>
  517. <li>
  518. <p>Gateway forwards all subsequent presence stanzas to Legacy Users (except those of type "probe" and those addressed to the Gateway itself).</p>
  519. <example caption="Jabber User Modifies Presence"><![CDATA[
  520. <presence from='romeo@montague.lit/orchard'
  521. to='juliet@aim.shakespeare.lit'>
  522. <show>dnd</show>
  523. <status>Wooing Juliet</status>
  524. </presence>
  525. ]]></example>
  526. </li>
  527. <li><p>Use Case Ends.</p></li>
  528. </ol>
  529. </section3>
  530. <section3 topic='Alternate Flows' anchor='usecases-jabber-login-alt'>
  531. <ol>
  532. <li><p>Login fails:</p>
  533. <ol>
  534. <li>
  535. <p>Gateway sends appropriate presence error to Jabber User (&notauthorized; if password is bad, &timeout; if Legacy Service is down, etc.).</p>
  536. <example caption="Gateway Informs Jabber User of Failed Login"><![CDATA[
  537. <presence to='aim.shakespeare.lit'
  538. from='romeo@shakespeare.lit'
  539. type='error'>
  540. <error code='504' type='wait'>
  541. <remote-server-timeout
  542. xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  543. </error>
  544. </presence>
  545. ]]></example>
  546. </li>
  547. <li><p>Use Case Ends unsuccessfully.</p></li>
  548. </ol>
  549. </li>
  550. </ol>
  551. </section3>
  552. </section2>
  553. <section2 topic='Log Out' anchor='usecases-jabber-logout'>
  554. <p>At any time after logging in to the Gateway, the Jabber User may log out of the Gateway and thereby end his or her session on the Legacy Service. This may happen automatically when the Jabber User terminates his or her session with a Jabber server, or independently of any session on the Jabber network by manually logging out of the Gateway.</p>
  555. <section3 topic='Primary Flow' anchor='usecases-jabber-logout-pri'>
  556. <ol>
  557. <li>
  558. <p>Jabber User sends unavailable presence broadcast to Server or sends directed presence stanza of type "unavailable" to Gateway or (if Gateway does not support directed presence) Legacy User.</p>
  559. <example caption="Jabber User Sends Unavailable Presence"><![CDATA[
  560. <presence type='unavailable'/>
  561. ]]></example>
  562. <example caption="Jabber User's Server Broadcasts Unavailable Presence"><![CDATA[
  563. <presence type='unavailable'
  564. from='romeo@montague.lit/orchard'
  565. to='aim.shakespeare.lit'/>
  566. ]]></example>
  567. </li>
  568. <li><p>Gateway transforms unavailable presence stanzas received from the Jabber User's server and routes them to all of the Jabber User's contacts on Legacy Service.</p></li>
  569. <li><p>Gateway logs Jabber User out of Legacy Service [A1].</p></li>
  570. <li>
  571. <p>Gateway sends presence stanza of type "unavailable" to Jabber User.</p>
  572. <example caption="Gateway Logs User Out"><![CDATA[
  573. <presence type='unavailable'
  574. from='aim.shakespeare.lit'
  575. to='romeo@montague.lit/orchard'/>
  576. ]]></example>
  577. </li>
  578. <li><p>Use Case Ends.</p></li>
  579. </ol>
  580. </section3>
  581. <section3 topic='Alternate Flows' anchor='usecases-jabber-logout-alt'>
  582. <ol>
  583. <li><p>Legacy Service supports directed presence and Gateway receives presence stanza of type "unavailable" directed to a Legacy User:</p>
  584. <ol>
  585. <li>
  586. <p>Gateway passes through directed unavailable presence to Legacy User.</p>
  587. <example caption="Jabber User Becomes Unavailable"><![CDATA[
  588. <presence type='unavailable'
  589. from='romeo@montague.lit/orchard'
  590. to='juliet@aim.shakespeare.lit'/>
  591. ]]></example>
  592. </li>
  593. <li><p>Use Case Ends.</p></li>
  594. </ol>
  595. </li>
  596. </ol>
  597. </section3>
  598. </section2>
  599. <section2 topic='Add Contact' anchor='usecases-jabber-addcontact'>
  600. <p>After registering with the Gateway, the Jabber User may want to add Legacy Users to his or her Jabber roster.</p>
  601. <section3 topic='Primary Flow' anchor='usecases-jabber-addcontact-pri'>
  602. <ol>
  603. <li>
  604. <p>Jabber User sends presence stanza of type "subscribe" to Legacy User.</p>
  605. <example caption="Jabber User Sends Subscription Request to Legacy User"><![CDATA[
  606. <presence type='subscribe'
  607. from='romeo@montague.lit'
  608. to='CapuletNurse@aim.shakespeare.lit'/>
  609. ]]></example>
  610. <p>Note: As specified in <cite>RFC 6121</cite>, sending this packet will result in a "roster push" from the Server to all of the Jabber User's available resources.</p>
  611. </li>
  612. <li><p>Gateway transforms subscription request and routes it to Legacy User.</p></li>
  613. <li>
  614. <p>If Legacy User approves subscription request, Gateway sends presence stanza of type "subscribed" to Jabber User on behalf of Legacy User. [A1]</p>
  615. <example caption="Gateway Approves Subscription Request on Behalf of Legacy User"><![CDATA[
  616. <presence type='subscribed'
  617. from='CapuletNurse@aim.shakespeare.lit'
  618. to='romeo@montague.lit'/>
  619. ]]></example>
  620. </li>
  621. <li>
  622. <p>Gateway sends available presence stanza to Jabber User on behalf of Legacy User.</p>
  623. <example caption="Gateway Sends Legacy User's Current Presence Information to Jabber User"><![CDATA[
  624. <presence from='CapuletNurse@aim.shakespeare.lit'
  625. to='romeo@montague.lit/orchard'/>
  626. ]]></example>
  627. </li>
  628. <li>
  629. <p>Gateway sends presence stanza of type "subscribe" to Jabber User on behalf of Legacy User.</p>
  630. <example caption="Gateway Sends Subscription Request to Jabber User on Behalf of Legacy User"><![CDATA[
  631. <presence type='subscribe'
  632. from='CapuletNurse@aim.shakespeare.lit'
  633. to='romeo@montague.lit'/>
  634. ]]></example>
  635. </li>
  636. <li>
  637. <p>Jabber User sends presence stanza of type "subscribed" to Legacy User.</p>
  638. <example caption="Jabber User Approves Subscription Request"><![CDATA[
  639. <presence type='subscribed'
  640. from='romeo@montague.lit'
  641. to='CapuletNurse@aim.shakespeare.lit'/>
  642. ]]></example>
  643. </li>
  644. <li><p>Use Case Ends.</p></li>
  645. </ol>
  646. </section3>
  647. <section3 topic='Alternate Flows' anchor='usecases-jabber-addcontact-alt'>
  648. <ol>
  649. <li>
  650. <p>Legacy User denies subscription request:</p>
  651. <ol>
  652. <li>
  653. <p>Gateway transforms subscription denial and routes it to Jabber User.</p>
  654. <example caption="Legacy User Denies Subscription Request"><![CDATA[
  655. <presence type='unsubscribed'
  656. from='juliet@aim.shakespeare.lit'
  657. to='romeo@montague.lit'/>
  658. ]]></example>
  659. </li>
  660. <li><p>Use Case Ends unsuccessfully.</p></li>
  661. </ol>
  662. </li>
  663. </ol>
  664. </section3>
  665. </section2>
  666. <section2 topic='Delete Contact' anchor='usecases-jabber-deletecontact'>
  667. <p>After adding a Legacy User to his or her Jabber roster, the Jabber User may want to delete that contact.</p>
  668. <section3 topic='Primary Flow' anchor='usecases-jabber-deletecontact-pri'>
  669. <ol>
  670. <li>
  671. <p>Jabber User sends IQ-set qualified by the 'jabber:iq:roster' namespace, containing subscription attribute with value of "remove".</p>
  672. <example caption="User Removes Roster Entry for Legacy User"><![CDATA[
  673. <iq type='set'
  674. from='romeo@montague.lit/orchard'
  675. id='remove1'>
  676. <query xmlns='jabber:iq:roster'>
  677. <item jid='CapuletNurse@aim.shakespeare.lit'
  678. subscription='remove'/>
  679. </query>
  680. </iq>
  681. ]]></example>
  682. </li>
  683. <li>
  684. <p>Server sends normal "roster push" to Jabber User (see <cite>RFC 6121</cite>) and sends presence stanzas of type "unsubscribe", "unsubscribed", and "unavailable" to Legacy User.</p>
  685. <example caption="Server Sends Presence Changes to Legacy User"><![CDATA[
  686. <presence type='unsubscribe'
  687. from='romeo@montague.lit'
  688. to='CapuletNurse@aim.shakespeare.lit'/>
  689. <presence type='unsubscribed'
  690. from='romeo@montague.lit'
  691. to='CapuletNurse@aim.shakespeare.lit'/>
  692. <presence type='unavailable'
  693. from='romeo@montague.lit/orchard'
  694. to='CapuletNurse@aim.shakespeare.lit'/>
  695. ]]></example>
  696. </li>
  697. <li><p>Gateway cleans up subscription state, informs Legacy User that Jabber User is unavailable, and MUST NOT send future changes in Jabber User's presence to Legacy User.</p></li>
  698. <li><p>Use Case Ends.</p></li>
  699. </ol>
  700. </section3>
  701. <section3 topic='Alternate Flows' anchor='usecases-jabber-deletecontact-alt'>
  702. <p>None.</p>
  703. </section3>
  704. </section2>
  705. <section2 topic='Send Message' anchor='usecases-jabber-send'>
  706. <p>Naturally, the Jabber User may want to exchange messages with a Legacy User. For the purposes of this document, we discuss one-to-one messaging only (i.e., groupchat messages, such as those defined in &xep0045;, are out of scope).</p>
  707. <section3 topic='Primary Flow' anchor='usecases-jabber-send-pri'>
  708. <ol>
  709. <li>
  710. <p>Jabber User sends message stanza to Legacy User.</p>
  711. <example caption="Jabber User Sends Message to Legacy User"><![CDATA[
  712. <message from='romeo@montague.lit/orchard'
  713. to='juliet@aim.shakespeare.lit'
  714. type='chat'>
  715. <body>Neither, fair saint, if either thee dislike.</body>
  716. </message>
  717. ]]></example>
  718. </li>
  719. <li><p>Gateway transforms message to legacy protocol and sends to Legacy User [A1].</p></li>
  720. <li><p>Use Case Ends.</p></li>
  721. </ol>
  722. </section3>
  723. <section3 topic='Alternate Flows' anchor='usecases-jabber-send-alt'>
  724. <ol>
  725. <li><p>Legacy Service reports error.</p></li>
  726. <li>
  727. <p>Gateway sends appropriate error to Jabber User:</p>
  728. <ul>
  729. <li><p>&notfound; -- Legacy User address is not valid.</p></li>
  730. <li><p>&registration; -- Jabber User is not registered with Gateway.</p></li>
  731. <li><p>&unavailable; -- Legacy User is offline and Legacy Service (or Gateway) does not provide offline message storage.</p></li>
  732. <li><p>&timeout; -- Legacy Service cannot be reached.</p></li>
  733. </ul>
  734. </li>
  735. <li><p>Use Case Ends unsuccessfully.</p></li>
  736. </ol>
  737. </section3>
  738. </section2>
  739. </section1>
  740. <section1 topic='Legacy User Use Cases' anchor='usecases-legacy'>
  741. <section2 topic='Add Contact' anchor='usecases-legacy-add'>
  742. <p>The Legacy User may want to add the Jabber User to his or her contact list on the Legacy Service. Because the Jabber User has an account on the Legacy Service by definition, the Legacy User will actually add the Jabber User's legacy address to his or her contact list, not the Jabber User's address on the Jabber/XMPP network.</p>
  743. <section3 topic='Primary Flow' anchor='usecases-legacy-add-pri'>
  744. <ol>
  745. <li><p>Legacy User requests subscription to Jabber User's legacy address (using legacy protocol).</p></li>
  746. <li>
  747. <p>Gateway sends presence stanza of type "subscribe" to Jabber User on behalf of Legacy User. (Note: Gateway MUST NOT send presence stanza of type "subscribed".)</p>
  748. <example caption="Gateway Sends Subscription Request on Behalf of Legacy User"><![CDATA[
  749. <presence type='subscribe'
  750. from='CapuletNurse@aim.shakespeare.lit'
  751. to='romeo@montague.lit'/>
  752. ]]></example>
  753. </li>
  754. <li>
  755. <p>Jabber User approves subscription request by sending presence stanza of type "subscribed" to Legacy User [A1].</p>
  756. <example caption="Jabber User Approves Subscription Request"><![CDATA[
  757. <presence type='subscribed'
  758. from='romeo@montague.lit'
  759. to='CapuletNurse@aim.shakespeare.lit'/>
  760. ]]></example>
  761. </li>
  762. <li><p>Gateway sends Jabber User's presence information to Legacy User.</p></li>
  763. <li>
  764. <p>Jabber User's Client sends presence stanza of type "subscribe" to Legacy User.</p>
  765. <example caption="Jabber User Sends Subscription Request to Legacy User"><![CDATA[
  766. <presence type='subscribe'
  767. from='romeo@montague.lit'
  768. to='CapuletNurse@aim.shakespeare.lit'/>
  769. ]]></example>
  770. </li>
  771. <li>
  772. <p>Gateway sends presence stanza of type "subscribed" to Jabber User on behalf of Legacy User.</p>
  773. <example caption="Gateway Approves Subscription Request on Behalf of Legacy User"><![CDATA[
  774. <presence type='subscribed'
  775. from='CapuletNurse@aim.shakespeare.lit'
  776. to='romeo@montague.lit'/>
  777. ]]></example>
  778. </li>
  779. <li>
  780. <p>Gateway sends Legacy User's presence information to Jabber User.</p>
  781. <example caption="Gateway Sends Legacy User's Current Presence Information to Jabber User"><![CDATA[
  782. <presence from='CapuletNurse@aim.shakespeare.lit'
  783. to='romeo@montague.lit/orchard'/>
  784. ]]></example>
  785. </li>
  786. <li><p>Use Case Ends.</p></li>
  787. </ol>
  788. </section3>
  789. <section3 topic='Alternate Flows' anchor='usecases-legacy-add-alt'>
  790. <ol>
  791. <li><p>Jabber User denies subscription request:</p>
  792. <ol>
  793. <li>
  794. <p>Jabber User sends presence stanza of type "unsubscribed" to Legacy User.</p>
  795. <example caption="Jabber User Denies Subscription Request"><![CDATA[
  796. <presence type='unsubscribed'
  797. from='romeo@montague.lit'
  798. to='CapuletNurse@aim.shakespeare.lit'/>
  799. ]]></example>
  800. </li>
  801. <li><p>Gateway cleans up subscription state and MUST NOT send Jabber User's presence to Legacy User.</p></li>
  802. <li><p>Use Case Ends unsuccessfully.</p></li>
  803. </ol>
  804. </li>
  805. </ol>
  806. </section3>
  807. </section2>
  808. <section2 topic='Delete Contact' anchor='usecases-legacy-delete'>
  809. <p>After adding the Jabber User to his or her legacy contact list, the Legacy User may want to delete the Jabber User.</p>
  810. <section3 topic='Primary Flow' anchor='usecases-legacy-delete-pri'>
  811. <ol>
  812. <li><p>Legacy User deletes Jabber User's legacy address (using legacy protocol).</p></li>
  813. <li>
  814. <p>Gateway sends presence stanzas of type "unsubscribe", "unsubscribed", and "unavailable" to Jabber User on behalf of Legacy User.</p>
  815. <example caption="Gateway Cleans Up Subscription on Behalf of Legacy User"><![CDATA[
  816. <presence type='unsubscribe'
  817. from='CapuletNurse@aim.shakespeare.lit'
  818. to='romeo@montague.lit'/>
  819. <presence type='unsubscribed'
  820. from='CapuletNurse@aim.shakespeare.lit'
  821. to='romeo@montague.lit'/>
  822. <presence type='unavailable'
  823. from='CapuletNurse@aim.shakespeare.lit'
  824. to='romeo@montague.lit/orchard'/>
  825. ]]></example>
  826. </li>
  827. <li><p>Jabber User's server performs defined functionality for handling presence stanzas of type "unsubscribe" and "unsubscribed" (see <cite>RFC 6121</cite>).</p></li>
  828. <li><p>Use Case Ends.</p></li>
  829. </ol>
  830. </section3>
  831. <section3 topic='Alternate Flows' anchor='usecases-legacy-delete-alt'>
  832. <p>None.</p>
  833. </section3>
  834. </section2>
  835. <section2 topic='Send Message' anchor='usecases-legacy-send'>
  836. <p>Naturally, the Legacy User may want to exchange messages with the Jabber User. (Here again, groupchat messages are out of scope.)</p>
  837. <section3 topic='Primary Flow' anchor='usecases-legacy-send-pri'>
  838. <ol>
  839. <li><p>Legacy User sends message to Jabber User using legacy protocol.</p></li>
  840. <li>
  841. <p>Gateway transforms message and routes to Jabber User.</p>
  842. <example caption="Legacy User Sends Message to Jabber User"><![CDATA[
  843. <message from='juliet@aim.shakespeare.lit'
  844. to='romeo@montague.lit'>
  845. <body>Art thou not Romeo, and a Montague?</body>
  846. </message>
  847. ]]></example>
  848. <p>Note: If the Legacy Service to which the Gateway connects does not support a concept equivalent to that of Jabber "resources" as described in &rfc6120;, the 'from' address of message stanzas generated by a gateway SHOULD NOT include a resource identifier (i.e., they SHOULD be of the form &lt;user@host&gt; rather than &lt;user@host/resource&gt;). However, the 'from' address MAY include a resource if the Gateway determines that this is appropriate in the context of its communications with the Legacy Service.</p>
  849. </li>
  850. <li><p>Jabber User's Server delivers message or (optionally) stores it for later retrieval.</p></li>
  851. <li><p>Use Case Ends.</p></li>
  852. </ol>
  853. </section3>
  854. <section3 topic='Alternate Flows' anchor='usecases-legacy-send-alt'>
  855. <p>None.</p>
  856. </section3>
  857. </section2>
  858. </section1>
  859. <section1 topic='Addressing' anchor='addressing'>
  860. <section2 topic='Gateways' anchor='addressing-gateway'>
  861. <p>The address of a gateway itself SHOULD be a hostname only, and that hostname SHOULD NOT be supplemented with a resource identifier when referring to the gateway's address (e.g., when storing the gateway in a roster).</p>
  862. </section2>
  863. <section2 topic='Users' anchor='addressing-user'>
  864. <p>The Jabber Identifier corresponding to a Legacy User's address is typically of the form &lt;LegacyUserAddress@gateway.example.com&gt;, where LegacyUserAddress is the Legacy User's address on the Legacy Service and where gateway.example.com is the Jabber address of the gateway.</p>
  865. <p>Unfortunately, usernames on some Legacy Services may allow characters that are disallowed in Jabber usernames as specified by the Nodeprep profile of stringprep defined in <cite>RFC 3920</cite>. For example, the usernames for a Legacy Service may be of the form &lt;user@domain&gt;, which would result in an illegal JID such as &lt;user@domain@gateway.example.com&gt;.</p>
  866. <p>There are two possible ways to solve this problem:</p>
  867. <ol>
  868. <li>Use &xep0106;.</li>
  869. <li>Use the older 'jabber:iq:gateway' protocol (as documented in the following section).</li>
  870. </ol>
  871. <p>Gateways and clients SHOULD implement at least one of these protocols; at a minimum, it is RECOMMENDED for gateways and clients to implement the 'jabber:iq:gateway' protocol.</p>
  872. </section2>
  873. <section2 topic='The jabber:iq:gateway Protocol' anchor='addressing-iqgateway'>
  874. <p>The 'jabber:iq:gateway' protocol performs two functions:</p>
  875. <ol>
  876. <li><p>It enables a client to determine the text for the "prompt" to show to a Jabber User when the user wants to add a legacy contact to the user's roster (e.g., "Please enter the AOL Screen Name of the person you would like to contact"), as well as the preferred name for the prompted item (e.g., "Screen Name"). To do so, the client sends an empty &lt;query/&gt; element and the gateway returns a &lt;prompt/&gt; element (the name for the prompted item) and optionally a &lt;desc/&gt; element (the text of the prompt itself).</p></li>
  877. <li><p>It enables a client to send a legacy username to the gateway and receive a properly-formatted JID in return. To do so, the client sends the legacy address to the gateway as the character data of the &lt;prompt/&gt; element and the gateway returns a valid JID as the character data of the &lt;jid/&gt; element.</p></li>
  878. </ol>
  879. <p>Both uses are illustrated below.</p>
  880. <example caption='Client Requests Prompt'><![CDATA[
  881. <iq type='get' to='aim.jabber.org' from='stpeter@jabber.org/roundabout' id='gate1'>
  882. <query xmlns='jabber:iq:gateway'/>
  883. </iq>
  884. ]]></example>
  885. <example caption='Gateway Returns Prompt'><![CDATA[
  886. <iq type='result' from='aim.jabber.org' to='stpeter@jabber.org/roundabout' id='gate1'>
  887. <query xmlns='jabber:iq:gateway'>
  888. <desc>
  889. Please enter the AOL Screen Name of the
  890. person you would like to contact.
  891. </desc>
  892. <prompt>Contact ID</prompt>
  893. </query>
  894. </iq>
  895. ]]></example>
  896. <p>The following table is intended to assist implementors with mapping of gateway identities to English-language prompt names and text.</p>
  897. <table caption='Prompt Item Mapping (English)'>
  898. <tr>
  899. <th>Legacy Service</th>
  900. <th>Service Discovery Identity</th>
  901. <th>Prompt Name</th>
  902. <th>Prompt Text</th>
  903. </tr>
  904. <tr>
  905. <td>AOL Instant Messenger</td>
  906. <td>gateway/aim</td>
  907. <td>Contact ID</td>
  908. <td>Please enter the AOL Screen Name of the person you would like to contact.</td>
  909. </tr>
  910. <tr>
  911. <td>ICQ</td>
  912. <td>gateway/icq</td>
  913. <td>Contact ID</td>
  914. <td>Please enter the ICQ Number of the person you would like to contact.</td>
  915. </tr>
  916. <tr>
  917. <td>Windows Live Messenger</td>
  918. <td>gateway/msn <note>The service discovery type was originally defined as "msn" to reflect the name of the service as "MSN Messenger"; this type is retained even though the service has been renamed to "Windows Live Messenger".</note></td>
  919. <td>Contact ID</td>
  920. <td>Please enter the Windows Live Messenger address of the person you would like to contact.</td>
  921. </tr>
  922. <tr>
  923. <td>Yahoo! Messenger</td>
  924. <td>gateway/yahoo</td>
  925. <td>Contact ID</td>
  926. <td>Please enter the Yahoo ID of the person you would like to contact.</td>
  927. </tr>
  928. </table>
  929. <p>If the client provides an 'xml:lang' attribute with the IQ-get, the gateway SHOULD return localized prompt names and text if available, or default to English if not available.</p>
  930. <p>Once the user enters a legacy username or address, the client MUST send it to the gateway as the character data of the &lt;prompt/&gt; element in an IQ-set; the gateway MUST then return a properly-formed JID based on the provided by the client.</p>
  931. <example caption='Client Provides Legacy Username'><![CDATA[
  932. <iq type='set' to='aim.jabber.org' from='stpeter@jabber.org/roundabout' id='gate1'>
  933. <query xmlns='jabber:iq:gateway'>
  934. <prompt>Foo Bar</prompt>
  935. </query>
  936. </iq>
  937. ]]></example>
  938. <example caption='Gateway Returns JID'><![CDATA[
  939. <iq type='result' from='aim.jabber.org' to='stpeter@jabber.org/roundabout' id='gate1'>
  940. <query xmlns='jabber:iq:gateway'>
  941. <jid>FooBar@aim.jabber.org</jid>
  942. </query>
  943. </iq>
  944. ]]></example>
  945. </section2>
  946. </section1>
  947. <section1 topic='Contact Lists' anchor='rosters'>
  948. <p>Some legacy services maintain server-side contact lists, which are sent to the gateway when it logs in to the legacy service on behalf of the user. The gateway MAY initiate adding of the legacy contact list items to the user's Jabber roster. Some existing gateways do this by sending a presence stanza of type "subscribed" from the legacy contact's JID (e.g., &lt;LegacyUser@gateway.jabberserver.com&gt;) to the Jabber user; unfortunately, this behavior violates the presence stanza handling rules specified in <cite>RFC 6121</cite>. Therefore, a gateway SHOULD instead send the legacy contact list items to the Jabber User via the &xep0144; protocol.</p>
  949. </section1>
  950. <section1 topic='Business Rules' anchor='bizrules'>
  951. <p>The following business rules apply:</p>
  952. <ol>
  953. <li><p>A client SHOULD send a <cite>Service Discovery</cite> request to the gateway (and/or an <cite>Agent Information</cite> request to the gateway's parent) before requesting registration information.</p></li>
  954. <li><p>A gateway SHOULD support the <cite>Service Discovery</cite> protocol.</p></li>
  955. <li><p>A gateway SHOULD support the <cite>Agent Information</cite> protocol, although it is deprecated.</p></li>
  956. <li><p>A gateway SHOULD map, as best it can, the legacy registration fields onto the fields defined for the 'jabber:iq:register' namespace.</p></li>
  957. <li><p>A gateway SHOULD NOT attempt to emulate offline message storage functionality for legacy services that lack such functionality.</p></li>
  958. <li>
  959. <p>Existing gateway implementations do not strictly adhere to the bi-directional nature of Jabber presence notifications, since they do not broadcast presence from the gateway itself to registered users of the gateway, but rather wait for a registered user to send presence to the gateway before sending presence to the user. This sidesteps scalability challenges but may be sub-optimal; while this document does not require existing gateways to change their current behavior, it does RECOMMEND that they broadcast presence notifications to registered users in accordance with the standard Jabber presence model. Specifically:</p>
  960. <ul>
  961. <li><p>On startup, a gateway (1) SHOULD send presence to all registered users of that gateway but (2) MAY wait to receive presence changes from each registered user.</p></li>
  962. <li><p>On shutdown, a gateway SHOULD send unavailable presence to all registered users of the gateway.</p></li>
  963. </ul>
  964. </li>
  965. </ol>
  966. </section1>
  967. <section1 topic='Security Considerations' anchor='security'>
  968. <p>As defined herein, a gateway is a <em>client proxy</em>, since it "masquerades" as a user on a legacy instant messaging service. In order to act as a client proxy, the gateway logs into the user's account on the legacy service. This implies two things:</p>
  969. <ul>
  970. <li>The gateway must gather the legacy credentials from the user, and perhaps store them on the user's behalf.</li>
  971. <li>The gateway must provide the user's credentials to the legacy service.</li>
  972. </ul>
  973. <p>There are obvious security concerns with this approach. The concerns include:</p>
  974. <ol>
  975. <li>The user's credentials on the legacy service may be sent in the clear from the gateway to the legacy service if the legacy service does not support channel encryption or strong authentication.</li>
  976. <li>When the user informs the gateway of the user's legacy credentials, the credentials may be sent in the clear between the user's Jabber client and the user's Jabber server (if client-to-server channel encryption is not enabled) or between the user's Jabber server and the gateway (if the gateway is not in the user's "home" domain and server-to-server channel encryption is not enabled).</li>
  977. <li>If the gateway stores the user's legacy credentials after registration (this is the default behavior of most or all existing gateway implementations), the user's credentials could be acquired by a malicious user if the server hosting the gateway is compromised.</li>
  978. </ol>
  979. <p>There is no foreseeable solution to these concerns, since they are instrinsic to the client proxy model. Some assurance regarding the second and third concerns can be achieved if the user runs his or her own Jabber server and gateways. However, the only true solution is to move beyond the client proxy model, either by using Jabber for all IM communications or to convince legacy IM services to allow federated server-to-server communications using open protocols such as Jabber/XMPP, thus obviating the need for client proxy gateways entirely.</p>
  980. </section1>
  981. <section1 topic='IANA Considerations' anchor='iana'>
  982. <p>This document requires no interaction with &IANA;.</p>
  983. </section1>
  984. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  985. <section2 topic='Protocol Namespaces' anchor='registrar-ns'>
  986. <p>The &REGISTRAR; includes 'jabber:iq:gateway' in its registry of protocol namespaces.</p>
  987. </section2>
  988. </section1>
  989. <section1 topic='XML Schema' anchor='schema'>
  990. <code><![CDATA[
  991. <?xml version='1.0' encoding='UTF-8'?>
  992. <xs:schema
  993. xmlns:xs='http://www.w3.org/2001/XMLSchema'
  994. targetNamespace='jabber:iq:gateway'
  995. xmlns='jabber:iq:gateway'
  996. elementFormDefault='qualified'>
  997. <xs:annotation>
  998. <xs:documentation>
  999. The protocol documented by this schema is defined in
  1000. XEP-0100: http://www.xmpp.org/extensions/xep-0100.html
  1001. </xs:documentation>
  1002. </xs:annotation>
  1003. <xs:element name='query'>
  1004. <xs:complexType>
  1005. <xs:choice>
  1006. <xs:sequence>
  1007. <xs:element name='desc' minOccurs='0' type='xs:string'/>
  1008. <xs:element name='prompt' type='xs:string'/>
  1009. </xs:sequence>
  1010. <xs:element name='jid' type='xs:string'/>
  1011. </xs:choice>
  1012. </xs:complexType>
  1013. </xs:element>
  1014. </xs:schema>
  1015. ]]></code>
  1016. </section1>
  1017. </xep>