Openfire, bosh, converse.js(strophe) and autologin

Hi forum,

I’m struggling around a tricky problem and I’m not able to solve it yet.

I have a working Openfire 3.10.2 installation and I’d like to connect external http users with bosh.

Host machine is a 32bit CentOS 6.5 machine with openfire 3.10.2 RPM downloaded from your site.

On OpenFire settings:

  • http binding is enabled on ports 7070 and 7443 (SSL)

  • script syntax is enabled

  • CORS is enabled

  • No XFF (X-Forwarded-For) headers, standard cross-domain policy

  • Registration / Inband account registration is enabled

  • Registration / Change password enabled

  • Registration / Anonymous login enabled

I’m using Converse.js for my tests on this new webchat, manual login basically works fine so I’m happy with that.

BOSH URL is: “http://servername:7070/http-bind/” and I’m using an account: “test@servername” with “test” password for it.

Converse.js works out of the box with it so I can move to my planned architecture. I have an internal website and I’d like to have our logged users authenticated with OF. I have downloaded xmpp-prebind-php (https://github.com/candy-chat/xmpp-prebind-php) and I have created a basic script with few lines of php code for it:

require_once("lib/XmppPrebind.php");     $username = "test@servername";     $password = "test";     $jabberHost = "servername";     $boshUri    = "http://servername:7070/http-bind/";     $resource   = "resource";     $useSSL     = false;     $debug      = true;     $xmppPrebind = new XmppPrebind($jabberHost, $boshUri, $resource, $useSSL, $debug);     $xmppPrebind->connect($username, $password);     $xmppPrebind->auth();     $sessionInfo = $xmppPrebind->getSessionInfo(); // array containing sid, rid and jid

After auth() method I always get an error: “Invalid Login” and it seems I cannot authenticate to OF. I’m not focused on xmpp-prebind-php and I just need to use Converse.js with Openfire, is there anyone with a similar setup and maybe with a library and a working prebinding with Openfire ? Everytime I execute this code I can see:

Exception in thread “httpbind-worker-14” java.lang.NullPointerException at org.jivesoftware.openfire.net.SASLAuthentication.handle(SASLAuthentication.java :335) at org.jivesoftware.openfire.SessionPacketRouter.route(SessionPacketRouter.java:66 ) at org.jivesoftware.openfire.http.HttpSession.sendPendingPackets(HttpSession.java: 655) at org.jivesoftware.openfire.http.HttpSession$HttpPacketSender.run(HttpSession.jav a:1279) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

on “nohup.out” file and nothing special in other log files.

prebind-php basically sets some cookies in the browser session so Converse may read them and use them for the binding, is there someone with it ? Everything seems to be related to ejabberd and other servers but I’m really happy with Openfire and I’d like to keep it

Please let me know if you need further information about this setup, I can also adapt my setup to your files/configs, php is not mandatory so every working library is well accepted

Thank you in advance for your reply

Kind Regards

Ben