SASL PLAIN authentication failing with Jabber.org

In my Adobe Flex web based chat client project I'm using XIFF API and JHB servlet v 1.1.1 (for http-binding support) and I want to connect to Jabber.org server. XIFF suports SASL PLAIN, ANONYMOUS and EXTERNAL and since I want to do non-anonymous login so I can use only SASL PLAIN and EXTERNAL. but Jabber.org does not support latter so only one option remains - SASL PLAIN.

My client was unable to login using SASL PLAIN and I was getting 401: Authentication Error from server. I changed the format of username and password in packet to username@jabber.org/0username/0password and I started getting authentication success from Jabber.org server. But After XMPP Restart when the client sends resource binding packet I do not receive any response from Jabber.org apart from packet and after some time session times out.

Following are the logs from the client....

First request to server......

<body ver="1.6" secure="false" rid="691240" xmlns="http://jabber.org/protocol/httpbind" xmpp:version="1.0" wait="10" xmlns:xmpp="urn:xmpp:xbosh" hold="1" xml:lang="en" to="jabber.org" />

sending request......
<body ver="1.6" secure="false" rid="691240" xmlns="http://jabber.org/protocol/httpbind" xmpp:version="1.0" wait="10" xmlns:xmpp="urn:xmpp:xbosh" hold="1" xml:lang="en" to="jabber.org" />
Error: Ignoring policy file requested from http://jabber.org/crossdomain.xml because a cross-domain redirect to http://www.jabber.org/crossdomain.xml occurred.

Received from server......
>>>>> <body xmlns="http://jabber.org/protocol/httpbind" xmlns:stream="http://etherx.jabber.org/streams" authid="3244930549" inactivity="60" polling="2" requests="2" sid="DA8uQ4irwqhcFLUpUdWzD7OM" wait="10"><stream:features><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism></mechanisms><register xmlns="http://jabber.org/features/iq-register"/></stream:features></body>

sending request......
<body rid="691241" sid="DA8uQ4irwqhcFLUpUdWzD7OM" xmlns="http://jabber.org/protocol/httpbind"><auth mechanism="PLAIN" xmlns="urn:ietf:params:xml:ns:xmpp-sasl">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</auth></body>

Received from server......
>>>>> <body xmlns="http://jabber.org/protocol/httpbind"><success xmlns="jabber:client"/></body>

sending request......
<body rid="691242" to="jabber.org" xmlns:xmpp="urn:xmpp:xbosh" xmpp:restart="true" xml:lang="en" sid="DA8uQ4irwqhcFLUpUdWzD7OM" xmlns="http://jabber.org/protocol/httpbind" />

Received from server......
>>>>> <body xmlns="http://jabber.org/protocol/httpbind"/>

sending request......
<body rid="691243" sid="DA8uQ4irwqhcFLUpUdWzD7OM" xmlns="http://jabber.org/protocol/httpbind"><iq type="set" id="iq_1"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><resource>tab_client</resource></bind></iq></body>

Received from server......
>>>>> <body xmlns="http://jabber.org/protocol/httpbind"/>

--------------------------------------------------------------------------------------------------------------------------------------------------------------------

When I sniffed the network packets this was the last response before session timing out.

<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabb
er.org/streams' id='4210756225' from='jabber.org' xml:lang='en'><stream:error><invalid-namespace xml
ns='urn:ietf:params:xml:ns:xmpp-streams'/></stream:error></stream:stream>

I think there issue at server side because I'm not sending any invalid namespace.

Please note that JHB servlet v 1.1.1 supports TLS.

Delving more in the logs and

Delving more in the logs and BOSH implementation details I can see that I'm not getting any response from Jabber.org server for XMPP restart packet.

After this i Send resource binding packet but since the stream hasn't restarted I dont get that either.

Now what is the reason behind eJabberD 2.x version (Jabber.org) not responding to it? During my search and logs from successfully connecting client I see that client is not sending the OPEN stream tag prior to XMPP restart which is

<stream:stream to="jabber.org" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0" >

after successful Auth.

Is this tag required or is there some other problem with server? Actually due to technical issue with Flex I'm unable to create an OPEN stream tag. It always creates a CLOSED one so i cannot myself make change to the code and see the difference.

Problem solved

The issue was with JHB (JabberHTTPBind servlet v1.1.1). As the XMPP restart packet does not have child nodes so it was not forwarding it to the server. Though when you see the debug logs it prints XMPP RESTART so you think that the packet was sent. Only when we looked closely into the network traffic we noticed that. So it will be solved at JHB's end.

You are developing a XMPP client, right?

You are developing a XMPP client, right? Are you testing it with a public, free, production XMPP server? Do you consider this a good idea?

If your client is untested and buggy, is it a good idea to test it in a server where many other people are chatting?

Why don't you install ejabberd in your machine, and test your client against it? You can also install other free XMPP servers, and test your client against them, too.

Syndicate content