AUTHFAIL and Session timeout connecting to ejabberd with Strophe

576 views Asked by At

I have installed ejabberd 15.03 on Amazon linux EC2. I am using an external ODBC (MySQL) which is hosted on a separate instance. In-Band registration is disabled and I have my own scripts handling the registration. The setup is working fine and I am able to connect to the server using clients like Psi and also am able to connect using smack on android and even exchange messages The issue is with the http-bind setup. I am using Strophe along with Angular.js to create a web chat client. here is my ejabbed.yml:

port: 5280 module: ejabberd_http request_handlers: "/pub/archive": mod_http_fileserver "/http-bind": mod_http_bind web_admin: true http_poll: false http_bind: true ## register: true captcha: false

I also have the module enabled as below:

mod_http_bind: []

When I connect with strophe using: myapp.service('xmppAuth', function() { return {

auth: function(login, password) {
console.log(login+password);
  alert('connection start');
   connect = new Strophe.Connection('http://example.com:5280/http-bind/');
   connect.connect(login, password, function (status) {
    console.log(status);
       if (status === Strophe.Status.CONNECTED) {
        alert('connected with server');
         var iq = $iq({type: 'get'}).c('query', {xmlns: 'jabber:iq:roster'});
         connect.sendIQ(iq, on_roster);
         connect.addHandler(on_roster_changed,"jabber:iq:roster", "iq", "set");
         connect.addHandler(on_message,null, "message", "chat");
              }
              else
              {
               alert(Strophe.Status);
               console.log(Strophe.Status);
              }

       })

all I receive is status 4 which is AUTHFAIL. Any idea what I may be missing. When I access the http-bind url in the browser i receive: ejabberd mod_http_bind

An implementation of XMPP over BOSH (XEP-0206)

This web page is only informative.

To use HTTP-Bind you need a Jabber/XMPP client that supports it.

ejabberd.log: https://drive.google.com/file/d/0B-YNcaCq5wozN0hGQ2xWUHJ0b1U/view?usp=sharing

1

There are 1 answers

0
Hardy Singh On

Issue has been resolved. Missed something pretty obvious. The XMPP account password was an integer and I guess the connect function did not recognize it as a string, so a mismatch and auth failure.