Well, I use smack for a client, and JSJaC/JwChat for another.
smack should work using SASL, but OpenFire has a bug concerning compression (JM-1115).
Edit: if there’s anything in the logs, post excerpts. smack has a debug feature, have you used it? It allows you to see the packets sent/received. Use it as described in the documents
I enabled the debugger, and try sending a custom iq packet when the client login. And display the data inside the packet on the jsp page (the packet contain “connection successfully created” as the body of the iq).
On the tomcat log, i get the same error again.
But at the debugger, all packet were sent and able to receive the result packet. Even the connection that have the SASL error was also able to receive the result packet from server.
However, the connection that receive the SASL error was not able to show “connection successfully created” text on the browser.
It took me a while to figure out SASL in JsJaC, so I hope this post helps someone else in the future.
Not sure if this was fixed with jsjac 1.1 or one of the bug fixes I will list here, but I was able to successfully get SASL auth working with JSJAC by doing the following:
Use the latest JSJAC v1.1
Make sure var JSJACHBC_USE_BOSH_VER is set to false
Make sure var JSJAC_ALLOW_PLAIN is false to force secure sign in (optional)
On line 359 (compressed, otherwise search for this line), change:
response="’+response+’",charset=utf-8’;
to be
response="’+response+’",charset=utf-8 ';
** NOTE - the difference between the two lines is the space after the 8. This eliminates the “unknown” characters associated with the utf-8 charset in jsjac and is RFC compliant. I understand this is more of a jsjac bug, but it does make it work properly with openfire 3.5.2
I’ve tried my first steps with Smack 3.1.0 and I got the SaSL problem too. There’s a NPE in handling of the challenge received from the server. IIRC, it happens in Base64.encode() when accessing source.lenght (I don’t have the project here right now).
Note that I do not use any other library - just a test in a console Java app.