[jdev] When to pass the JID??

Aaron Kryptokos aaronkryptokos6 at aaronwl.com
Fri Jun 4 20:34:12 CDT 2010

Mason, Matt wrote:

> So can someone please tell me when the JID is
> passed from the client to the server?  The spec seems pretty verbose, 
> and oddly doesn’t appear to specifically state when the initial JID is 
> passed.

I'm sure you've figured out by now that the JID is passed from the 
server to the client, not from the client to the server.

This is one of the weirdest parts of XMPP in my opinion.  Most XMPP IM 
clients ask you for your JID, or ask you for some login info then 
speculate on what your JID might be; but the reality is that you don't 
know what your JID is until you connect and the server tells you after 
resource binding.

I think what it comes down to is pretty much all of the XMPP IM clients 
have this wrong.  They're asking all the wrong questions:

-node: Most clients ask for this, and it serves absolutely no purpose; 
you don't need it to log in, and the server is going to tell you what it 
is when you do, and if you put the wrong thing, no client I've tested 
will let you know that it was wrong when you connect.

-domain: You obviously need this, but it's wrong to assume that this 
domain will actually be part of your JID, like many clients do; GTalk is 
the best counterexample.

-username/accountinfo: This is obviously dependent on the authentication 
methods available, but it's essential the the client ask the user for 
this: many do not, or make incorrect assumptions that it is the same as 
the node, or hide the authentication info entry field somewhere 

I think the way this should work is the only two questions IM clients 
should ask about when setting up an existing account before talking to 
the server is
-Authentication: user/pass, or whatever is appropriate for supported 
authentication methods.  In fact, it may be best to wait until 
contacting the server for the first time to even ask for this so that 
you can be sure which methods are supported.  Anything else is just 

It's fine if a client remembers and displays the JID associated with an 
account, but I think this should only happen after talking to the server 
to see what the JID actually is.

More information about the JDev mailing list