Connection via BOSH http-bind not listed in ejabberdctl connected_users

Hi,

I'm using ejabberd 2.1.4 and authenticating users via PLAIN authentication.
I'm using a anonymous login. The user can specify a username but a password is not necessary
(config: [{auth_method, [anonymous]}, {allow_multiple_connections, false}, {anonymous_protocol, both}])

This is how I negotiate the connection:

1. client to server (start session)
<body xmlns="http://jabber.org/protocol/httpbind" hold="1" rid="311985980" to="chat2.myserver.com" route="chat2.myserver.com:5280" wait="60" xml:lang="en" xmlns:xmpp="urn:xmpp:bosh" xmpp:version="1.0"/>

2. server to client (session id)
<body xmlns='http://jabber.org/protocol/httpbind' sid='c3d07425a6ac005ad7419c71eaf6d0b9d2aaed83' wait='60' requests='2' inactivity='30' maxpause='120' polling='2' ver='1.8' from='chat2.myserver.com' secure='true' authid='2757744332' xmlns:xmpp='urn:xmpp:xbosh' xmlns:stream='http://etherx.jabber.org/streams' xmpp:version='1.0'><stream:features xmlns:stream='http://etherx.jabber.org/streams'><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>ANONYMOUS</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism></mechanisms><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='HzhW199FSAS7rIkHllLdacqERmE='/><register xmlns='http://jabber.org/features/iq-register'/></stream:features></body>

3. client to server (login with username and no password check)
<body xmlns="http://jabber.org/protocol/httpbind" rid="311985981" sid="c3d07425a6ac005ad7419c71eaf6d0b9d2aaed83"><auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="PLAIN">AEJPU0hfTVVDXzE5MTk4Nl83NQA0YzYwZjkwOTFhMjI5</auth></body>

4. server to client (login successful)
<body xmlns='http://jabber.org/protocol/httpbind'><success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/></body>

5. client to server (restart stream)
<body xmlns="http://jabber.org/protocol/httpbind" rid="311985982" sid="c3d07425a6ac005ad7419c71eaf6d0b9d2aaed83" to="chat2.myserver.com" xmlns:xmpp="urn:xmpp:xbosh" xmpp:restart="true" xmpp:version="1.0"/>

6. server to client (stream features)
<body xmlns='http://jabber.org/protocol/httpbind' sid='c3d07425a6ac005ad7419c71eaf6d0b9d2aaed83' wait='60' requests='2' inactivity='30' maxpause='120' polling='2' ver='1.8' from='chat2.myserver.com' secure='true' authid='2191765278' xmlns:xmpp='urn:xmpp:xbosh' xmlns:stream='http://etherx.jabber.org/streams' xmpp:version='1.0'><stream:features xmlns:stream='http://etherx.jabber.org/streams'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='HzhW199FSAS7rIkHllLdacqERmE='/><register xmlns='http://jabber.org/features/iq-register'/></stream:features></body>

7. client to server (bind resource)
<body xmlns="http://jabber.org/protocol/httpbind" rid="311985983" sid="c3d07425a6ac005ad7419c71eaf6d0b9d2aaed83"><iq xmlns="jabber:client" type="set" id="4c60f909380b1"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><resource>resource</resource></bind></iq></body>

8.server to client (full jid)
<body xmlns='http://jabber.org/protocol/httpbind'><iq xmlns='jabber:client' id='4c60f909380b1' type='result'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><jid>BOSH_MUC_191986_75@chat2.myserver.com/resource</jid></bind></iq></body>

Authenticaton seems to work according to the ejabberd.log:

"Accepted authentication for BOSH_MUC_191986_75 by ejabberd_auth_anonymous"

No error is shown but the user is not listed in "ejabberdctl connected_users".
Am I missing something?

Thanks for your help!

zaaas wrote: I'm using

zaaas wrote:

I'm using ejabberd 2.1.4 and authenticating users via PLAIN authentication.
I'm using a anonymous login. The user can specify a username but a password is not necessary (config: [{auth_method, [anonymous]},
{allow_multiple_connections, false},
{anonymous_protocol, both}])q

Accepted authentication for BOSH_MUC_191986_75 by ejabberd_auth_anonymous

No error is shown but the user is not listed in "ejabberdctl connected_users".
Am I missing something?

I have no clue why it fails for you. It could be related to BOSH, or to Anonymous, but it works for me.

I tried using ejabberd 2.1.4 and Oneteam with this configuration:

{hosts, ["localhost", "anon.localhost"]}.
{host_config, "anon.localhost", [{auth_method, anonymous},
                                 {allow_multiple_connections, false},
                                 {anonymous_protocol, both}]}.

The log says:

=INFO REPORT==== 11-Aug-2010::21:22:08 ===
I(<0.487.0>:ejabberd_c2s:580) : ({socket_state,ejabberd_http_bind,
{http_bind,<0.486.0>,{{127,0,0,1},52786}},ejabberd_http_bind})
Accepted authentication for BOSH_MUC_191986_75 by ejabberd_auth_anonymous

=INFO REPORT==== 11-Aug-2010::21:22:08 ===
I(<0.487.0>:ejabberd_c2s:839) : ({socket_state,ejabberd_http_bind,
{http_bind,<0.486.0>,{{127,0,0,1},52786}},ejabberd_http_bind})
Opened session for BOSH_MUC_191986_75@anon.localhost/OneTeam

The command line:

$ ejabberdctl connected_users
bosh_muc_191986_75@anon.localhost/OneTeam

I also see the user online in the ejabberd WebAdmin.

Syndicate content