Unable to get ejabberd prebind to work

Posted by cdecker on Server Fault See other posts from Server Fault or by cdecker
Published on 2012-06-19T20:09:06Z Indexed on 2012/06/19 21:18 UTC
Read the original article Hit count: 268

Filed under:

I'm trying to get the prebind of BOSH sessions to work.

I want to be able to authenticate a user in my CMS and then log him in when he accesses the chat, for this I found https://github.com/smokeclouds/http_prebind, it all works find and I was able to compile it with the following steps:

rake configure
sed -i 's/AUTH_USER/a_user/g' src/http_prebind.erl
sed -i 's/AUTH_PASSWORD/a_password/g' src/http_prebind.erl
sed -i 's/EJABBERD_DOMAIN/jabber.my.tld/g' src/http_prebind.erl
rake build
rake install

And then adding the http request bindings to the configuration:

  {5280, ejabberd_http, [
                         {request_handlers,
                          [
                           {["http-prebind"], http_prebind}
                          ]},
                         %%captcha,
                         http_bind,
                         http_poll,
                         http_prebind,
                         web_admin
                        ]}

 ]}.

As far as I understand it I should now be able to simply request a new session like this:

curl -u a_user:a_password http://jabber.my.tld:5280/http-prebind/some_user

But no matter what I always get Unauthorized as response.

Any idea about this one?

PS: I also tried Mod-Http-Pre-Bind, but as it does not require a password I would prefer to use http_prebind.

PPS: Does the user with username AUTH_USER and password AUTH_PASSWORD actually have to exist? I'm currently using an admin account.

© Server Fault or respective owner

Related posts about ejabberd