XML Stream Flow

User registration and user authorization are two processes that take place at the start of an XML stream, immediately following the XML stream header exchange. The Jabber server is designed to check for and process any user registration request or authentication request before anything else.

This makes sense, as outside of a session (a session is created for a user when the authentication completes successfully), any other element—a <message/> element, a <presence/> element, or an <iq/> element that doesn’t contain an extension qualified by the jabber:iq:register or jabber:iq:auth namespaces—is invalid. So if any of these other elements are sent before authentication has taken place (that is, before a session has been created for that connection), they are queued and processed after authentication.

Figure 7-1 shows the general flow within an XML stream, with regard to where the registration and/or authentication steps happen.

XML stream flow showing registration and authentication
Figure 7-1. XML stream flow showing registration and authentication

Get Programming Jabber now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.