Friday, July 29, 2011

Is it an Issue with Strophe.js? I am not Sure


Strophe.js is a chat client that can be used to connect to any XMPP enabled chat server. I have observed below issue when I tried to integrate with an Openfire server.

If you enable anonymous authentication in your XMPP server, then you can pass the username without @host. The API do authentication properly and continue. But if you are disabling anonymous authentication in the server, then you must specify user@host. Otherwise the API does not proceed and did not give any error as well. The API first make a connection to the server and query the authentication mechanisms used by the server. So when the server returns the authentication mechanisms, the API pick up the suitable one and proceed with login. But in case of non-anonymous login, the API does not proceed further if you are not providing the @host in username. XMPP server does not restrict this condition, I think it is a issue with Strophe.

The issue is a boolean check done in Strophe.js, in case of non-anonymous authentication. The first if condiction check for anonymous and second if-else ladder check for host server and if it is not present, then it will break the if loop and will not process with SASL or any other authentication.

njoy
Sajith

No comments: