candy-chat / xmpp-prebind-php

PHP class for creating a session on server side to an XMPP server
MIT License
63 stars 43 forks source link

always invalid login #6

Closed ksrichard closed 9 years ago

ksrichard commented 10 years ago

i used the code like in the example and i got always an error called "invalid login", I'm using openfire as the server.. can you help me? :)

ksrichard commented 10 years ago

okay if i comment out the other encryptions and I'm using only PLAIN it works, but not because if I wants to attach with strophe i got an error: "401 invalid sid"

akhileshpv commented 10 years ago

Hi,

I am using openfire in server and candy chat in my website. When I am trying to use xmpp-prebind-php library, I got the PHP Fatal error: Uncaught exception 'XmppPrebindException' with message 'Invalid login'.

I am using the below code: require_once './prebind/lib/XmppPrebind.php'; $xmppPrebind = new XmppPrebind('domain.com', 'http://domain.com:5280/http-bind/', 'Candy', false, true); $xmppPrebind->connect('akhilesh', 'akhilesh123'); $xmppPrebind->auth(); $sessionInfo = $xmppPrebind->getSessionInfo();

My openfire is installed in http://domain.com:9090

Anybody can solve this issue, Please help me...

Thanks, Akhilesh

maennchen commented 10 years ago

Hi Akhilesh

Are you sure that you're using the correct username and password?

Sent from my iPhone

On 18.07.2014, at 08:52, akhileshpv notifications@github.com wrote:

Hi,

I am using openfire in server and candy chat in my website. When I am trying to use xmpp-prebind-php library, I got the PHP Fatal error: Uncaught exception 'XmppPrebindException' with message 'Invalid login'.

I am using the below code: require_once './prebind/lib/XmppPrebind.php'; $xmppPrebind = new XmppPrebind('domain.com', 'http://domain.com:5280/http-bind/', 'Candy', false, true); $xmppPrebind->connect('akhilesh', 'akhilesh123'); $xmppPrebind->auth(); $sessionInfo = $xmppPrebind->getSessionInfo();

My openfire is installed in http://domain.com:9090

Anybody can solve this issue, Please help me...

Thanks, Akhilesh

— Reply to this email directly or view it on GitHub.

akhileshpv commented 10 years ago

Hi Jonatan,

Thanks for your mail. I am sure, this is correct username and password. Because I can login from candy chat with this same username and and password.

Full error report displayed in the browser is: Fatal error: Uncaught exception 'XmppPrebindException' with message 'Invalid login' in /home/dev001/projects/domain/candy/example/prebind/lib/XmppPrebind.php:188 Stack trace: #0 /home/dev001/projects/domain/candy/example/index.php(9): XmppPrebind->auth() #1 {main} thrown in /home/dev001/projects/domain/candy/example/prebind/lib/XmppPrebind.php on line 188

The response shows in the console log is: SENT: <?xml version="1.0" encoding="UTF-8"?> RECV:: stream:featuresDIGEST-MD5PLAINANONYMOUSCRAM-MD5zlib/stream:features sid: a06b5a38 encryption used: DIGEST-MD5 SENT: <?xml version="1.0" encoding="UTF-8"?> RECV:: cmVhbG09ImNuZXhpb24uY29tIixub25jZT0ibVoxRUVKMGNlSmsydFI5b1AxQ1VlNkh1R1NXRkVZUEV5RTVBSlRXNCIscW9wPSJhdXRoIixjaGFyc2V0PXV0Zi04LGFsZ29yaXRobT1tZDUtc2Vzcw== DIGEST-MD5 Auth String: username="admin",realm="domain.com",nonce="mZ1EEJ0ceJk2tR9oP1CUe6HuGSWFEYPEyE5AJTW4",cnonce="dqkfuhFlRhSdfNDJH7EGfSeB8uwnZgFC+x1PPjxulPg=",nc=00000001,qop=auth,digest-uri="xmpp/domain.com",response=5a7ca364193b1ad264791895d2228751,maxbuf=65536 SENT: <?xml version="1.0" encoding="UTF-8"?> dXNlcm5hbWU9ImFkbWluIixyZWFsbT0iY25leGlvbi5jb20iLG5vbmNlPSJtWjFFRUowY2VKazJ0UjlvUDFDVWU2SHVHU1dGRVlQRXlFNUFKVFc0Iixjbm9uY2U9ImRxa2Z1aEZsUmhTZGZOREpIN0VHZlNlQjh1d25aZ0ZDK3gxUFBqeHVsUGc9IixuYz0wMDAwMDAwMSxxb3A9YXV0aCxkaWdlc3QtdXJpPSJ4bXBwL2NuZXhpb24uY29tIixyZXNwb25zZT01YTdjYTM2NDE5M2IxYWQyNjQ3OTE4OTVkMjIyODc1MSxtYXhidWY9NjU1MzY= RECV:: cnNwYXV0aD1iZjY0NDdhNmM3MjkzYWY1YWRjMTMwZjg4MTFmNDdlNA== SENT: <?xml version="1.0" encoding="UTF-8"?> RECV::

Thansk, Akhilesh

On Fri, Jul 18, 2014 at 4:10 PM, Jonatan Männchen notifications@github.com wrote:

Hi Akhilesh

Are you sure that you're using the correct username and password?

Sent from my iPhone

On 18.07.2014, at 08:52, akhileshpv notifications@github.com wrote:

Hi,

I am using openfire in server and candy chat in my website. When I am trying to use xmpp-prebind-php library, I got the PHP Fatal error: Uncaught exception 'XmppPrebindException' with message 'Invalid login'.

I am using the below code: require_once './prebind/lib/XmppPrebind.php'; $xmppPrebind = new XmppPrebind('domain.com', ' http://domain.com:5280/http-bind/', 'Candy', false, true); $xmppPrebind->connect('akhilesh', 'akhilesh123'); $xmppPrebind->auth(); $sessionInfo = $xmppPrebind->getSessionInfo();

My openfire is installed in http://domain.com:9090

Anybody can solve this issue, Please help me...

Thanks, Akhilesh

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/candy-chat/xmpp-prebind-php/issues/6#issuecomment-49417821 .

AKHILESH PV Sr. Software Engineer Phone: +91 484 4054324 | akhilesh@cubettech.com

[image: http://cubettech.com/] http://cubettech.com/

maennchen commented 10 years ago

On weekdays I'm in military service and can't really analyse your logs / debug the problem...

maennchen commented 10 years ago

@mweibel Do you know how to solve this? On a cellphone my ressources are verry limited ;-)

mweibel commented 10 years ago

@akhileshpv could you show us by comparison a log from the failed login generated by the prebind lib?

akhileshpv commented 10 years ago

Hi Michael,

I have tested the xmpp-prebind-php library with different encryption methods like PLAIN, CRAM-MD5 and DIGEST-MD5. But I got different logs in console for each encryption methods. Can you please check it? Let me know, do we need to update any settings in openfire for properly process this section?

Openfire URL: http://cnexion.com:9090 HTTP Bind port: 5280 Login Credentials: akhilesh / akhilesh123

sid: f4a274d4 encryption used: PLAIN PLAIN Auth String: YWtoaWxlc2hAY25leGlvbi5jb20vQ2FuZHkAYWtoaWxlc2gAYWtoaWxlc2gxMjM=

SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1116428488" xml:lang="en" hold="1" to="cnexion.com" xmlns:xmpp="urn:xmpp:xbosh" xmpp:version="1.0" wait="60"/> RECV:: <body xmlns="http://jabber.org/protocol/httpbind" xmlns:stream=" http://etherx.jabber.org/streams" from="cnexion.com" authid="f4a274d4" sid="f4a274d4" secure="true" requests="2" inactivity="30" polling="5" wait="60">stream:features<mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">DIGEST-MD5PLAINANONYMOUSCRAM-MD5<compression xmlns="http://jabber.org/features/compress">zlib<bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/>/stream:features SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1116428489" xml:lang="en" sid="f4a274d4"><auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="PLAIN">YWtoaWxlc2hAY25leGlvbi5jb20vQ2FuZHkAYWtoaWxlc2gAYWtoaWxlc2gxMjM= RECV:: <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/> SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1116428490" xml:lang="en" sid="f4a274d4" to="cnexion.com" xmlns:xmpp="urn:xmpp:xbosh" xmpp:restart="true"/> RECV:: stream:featureszlib<bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/>/stream:features SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1116428491" xml:lang="en" sid="f4a274d4"><iq xmlns="jabber:client" type="set" id="bind_1361383888"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">Candy RECV:: <iq xmlns="jabber:client" type="result" id="bind_1361383888" to=" cnexion.com/f4a274d4"> akhilesh@cnexion.com/Candy SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1116428492" xml:lang="en" sid="f4a274d4"><iq xmlns="jabber:client" type="set" id="session_auth_336107106"><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/> RECV:: <iq xmlns="jabber:client" type="result" id="session_auth_336107106" to=" akhilesh@cnexion.com/Candy"/> SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1116428493" xml:lang="en" sid="f4a274d4"><auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="PLAIN">YWtoaWxlc2hAY25leGlvbi5jb20vQ2FuZHkAYWtoaWxlc2gAYWtoaWxlc2gxMjM= RECV:: <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/> SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1116428494" xml:lang="en" sid="f4a274d4" to="cnexion.com" xmlns:xmpp="urn:xmpp:xbosh" xmpp:restart="true"/> RECV:: stream:featureszlib<bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/>/stream:features SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1116428495" xml:lang="en" sid="f4a274d4"><iq xmlns="jabber:client" type="set" id="bind_987398258"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">Candy RECV:: <stream:error xmlns:stream="http://etherx.jabber.org/streams"><conflict xmlns="urn:ietf:params:xml:ns:xmpp-streams"/>/stream:error SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1116428496" xml:lang="en" sid="f4a274d4"><iq xmlns="jabber:client" type="set" id="session_auth_2069738843"><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/> RECV:: <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/> Error 404 Invalid SID.

HTTP ERROR: 404

Problem accessing /http-bind/. Reason:

 Invalid SID.


Powered by Jetty://

sid: 18c83aae encryption used: CRAM-MD5 CRAM-MD5 Auth String: akhilesh 2d4de58dff82eaded082c7495dec2984

SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1177582256" xml:lang="en" hold="1" to="cnexion.com" xmlns:xmpp="urn:xmpp:xbosh" xmpp:version="1.0" wait="60"/> RECV:: <body xmlns="http://jabber.org/protocol/httpbind" xmlns:stream=" http://etherx.jabber.org/streams" from="cnexion.com" authid="18c83aae" sid="18c83aae" secure="true" requests="2" inactivity="30" polling="5" wait="60">stream:features<mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">DIGEST-MD5PLAINANONYMOUSCRAM-MD5<compression xmlns="http://jabber.org/features/compress">zlib<bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/>/stream:features SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1177582257" xml:lang="en" sid="18c83aae"><auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="CRAM-MD5"/> RECV:: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">PDg0MDgzMzgzMzYxNTA3NjQ2MDEuMTQwNTkzMjQyODE3OEBjbmV4aW9uLmNvbT4= SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1177582258" xml:lang="en" sid="18c83aae"><response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">YWtoaWxlc2ggMmQ0ZGU1OGRmZjgyZWFkZWQwODJjNzQ5NWRlYzI5ODQ= RECV:: <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/>

sid: bcb2256a encryption used: DIGEST-MD5

DIGEST-MD5 Auth String: username="akhilesh",realm="cnexion.com ",nonce="xPmfqceGOcKNIy2rv7KG4S4JODo0KPIPvaNc1WEK",cnonce="QbITqlwal4LDS9QJqdhSYl0uBUjhMr/LIxd5lcH7Ru4=",nc=00000001,qop=auth,digest-uri="xmpp/ cnexion.com",response=4a3f8bc78c1c36b0ae7ca6121c51839b,maxbuf=65536

SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1122203497" xml:lang="en" hold="1" to="cnexion.com" xmlns:xmpp="urn:xmpp:xbosh" xmpp:version="1.0" wait="60"/> RECV:: <body xmlns="http://jabber.org/protocol/httpbind" xmlns:stream=" http://etherx.jabber.org/streams" from="cnexion.com" authid="bcb2256a" sid="bcb2256a" secure="true" requests="2" inactivity="30" polling="5" wait="60">stream:features<mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">DIGEST-MD5PLAINANONYMOUSCRAM-MD5<compression xmlns="http://jabber.org/features/compress">zlib<bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/>/stream:features SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1122203498" xml:lang="en" sid="bcb2256a"><auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="DIGEST-MD5"/> RECV:: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cmVhbG09ImNuZXhpb24uY29tIixub25jZT0ieFBtZnFjZUdPY0tOSXkycnY3S0c0UzRKT0RvMEtQSVB2YU5jMVdFSyIscW9wPSJhdXRoIixjaGFyc2V0PXV0Zi04LGFsZ29yaXRobT1tZDUtc2Vzcw==

Thanks, Akhilesh

On Mon, Jul 21, 2014 at 5:36 PM, Michael Weibel notifications@github.com wrote:

@akhileshpv https://github.com/akhileshpv could you show us by comparison a log from the failed login generated by the prebind lib?

— Reply to this email directly or view it on GitHub https://github.com/candy-chat/xmpp-prebind-php/issues/6#issuecomment-49597555 .

AKHILESH PV Sr. Software Engineer Phone: +91 484 4054324 | akhilesh@cubettech.com

[image: http://cubettech.com/] http://cubettech.com/

akhileshpv commented 10 years ago

Hi Michael,

Let me know, did you get any solution for this query?

Thanks, Akhilesh

On Mon, Jul 21, 2014 at 5:44 PM, Akhilesh PV akhilesh@cubettech.com wrote:

Hi Michael,

I have tested the xmpp-prebind-php library with different encryption methods like PLAIN, CRAM-MD5 and DIGEST-MD5. But I got different logs in console for each encryption methods. Can you please check it? Let me know, do we need to update any settings in openfire for properly process this section?

Openfire URL: http://cnexion.com:9090 HTTP Bind port: 5280 Login Credentials: akhilesh / akhilesh123

sid: f4a274d4 encryption used: PLAIN PLAIN Auth String: YWtoaWxlc2hAY25leGlvbi5jb20vQ2FuZHkAYWtoaWxlc2gAYWtoaWxlc2gxMjM= SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1116428488" xml:lang="en" hold="1" to="cnexion.com" xmlns:xmpp="urn:xmpp:xbosh" xmpp:version="1.0" wait="60"/> RECV:: <body xmlns="http://jabber.org/protocol/httpbind" xmlns:stream=" http://etherx.jabber.org/streams" from="cnexion.com" authid="f4a274d4" sid="f4a274d4" secure="true" requests="2" inactivity="30" polling="5" wait="60">stream:features<mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">DIGEST-MD5PLAINANONYMOUSCRAM-MD5<compression xmlns="http://jabber.org/features/compress">zlib<bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/>/stream:features SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1116428489" xml:lang="en" sid="f4a274d4"><auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="PLAIN">YWtoaWxlc2hAY25leGlvbi5jb20vQ2FuZHkAYWtoaWxlc2gAYWtoaWxlc2gxMjM= RECV:: <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/> SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1116428490" xml:lang="en" sid="f4a274d4" to="cnexion.com" xmlns:xmpp="urn:xmpp:xbosh" xmpp:restart="true"/> RECV:: stream:featureszlib<bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/>/stream:features SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1116428491" xml:lang="en" sid="f4a274d4"><iq xmlns="jabber:client" type="set" id="bind_1361383888"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">Candy RECV:: <iq xmlns="jabber:client" type="result" id="bind_1361383888" to=" cnexion.com/f4a274d4"> akhilesh@cnexion.com/Candy SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1116428492" xml:lang="en" sid="f4a274d4"><iq xmlns="jabber:client" type="set" id="session_auth_336107106"><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/> RECV:: <iq xmlns="jabber:client" type="result" id="session_auth_336107106" to=" akhilesh@cnexion.com/Candy"/> SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1116428493" xml:lang="en" sid="f4a274d4"><auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="PLAIN">YWtoaWxlc2hAY25leGlvbi5jb20vQ2FuZHkAYWtoaWxlc2gAYWtoaWxlc2gxMjM= RECV:: <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/> SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1116428494" xml:lang="en" sid="f4a274d4" to="cnexion.com" xmlns:xmpp="urn:xmpp:xbosh" xmpp:restart="true"/> RECV:: stream:featureszlib<bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/>/stream:features SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1116428495" xml:lang="en" sid="f4a274d4"><iq xmlns="jabber:client" type="set" id="bind_987398258"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">Candy RECV:: <stream:error xmlns:stream="http://etherx.jabber.org/streams"><conflict xmlns="urn:ietf:params:xml:ns:xmpp-streams"/>/stream:error SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1116428496" xml:lang="en" sid="f4a274d4"><iq xmlns="jabber:client" type="set" id="session_auth_2069738843"><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/> RECV:: <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/> Error 404 Invalid SID.

HTTP ERROR: 404

Problem accessing /http-bind/. Reason:

 Invalid SID.


Powered by Jetty://

sid: 18c83aae encryption used: CRAM-MD5 CRAM-MD5 Auth String: akhilesh 2d4de58dff82eaded082c7495dec2984 SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1177582256" xml:lang="en" hold="1" to="cnexion.com" xmlns:xmpp="urn:xmpp:xbosh" xmpp:version="1.0" wait="60"/> RECV:: <body xmlns="http://jabber.org/protocol/httpbind" xmlns:stream=" http://etherx.jabber.org/streams" from="cnexion.com" authid="18c83aae" sid="18c83aae" secure="true" requests="2" inactivity="30" polling="5" wait="60">stream:features<mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">DIGEST-MD5PLAINANONYMOUSCRAM-MD5<compression xmlns="http://jabber.org/features/compress">zlib<bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/>/stream:features SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1177582257" xml:lang="en" sid="18c83aae"><auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="CRAM-MD5"/> RECV:: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">PDg0MDgzMzgzMzYxNTA3NjQ2MDEuMTQwNTkzMjQyODE3OEBjbmV4aW9uLmNvbT4= SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1177582258" xml:lang="en" sid="18c83aae"><response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">YWtoaWxlc2ggMmQ0ZGU1OGRmZjgyZWFkZWQwODJjNzQ5NWRlYzI5ODQ= RECV:: <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/>

sid: bcb2256a encryption used: DIGEST-MD5 DIGEST-MD5 Auth String: username="akhilesh",realm="cnexion.com ",nonce="xPmfqceGOcKNIy2rv7KG4S4JODo0KPIPvaNc1WEK",cnonce="QbITqlwal4LDS9QJqdhSYl0uBUjhMr/LIxd5lcH7Ru4=",nc=00000001,qop=auth,digest-uri="xmpp/ cnexion.com",response=4a3f8bc78c1c36b0ae7ca6121c51839b,maxbuf=65536 SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1122203497" xml:lang="en" hold="1" to="cnexion.com" xmlns:xmpp="urn:xmpp:xbosh" xmpp:version="1.0" wait="60"/> RECV:: <body xmlns="http://jabber.org/protocol/httpbind" xmlns:stream=" http://etherx.jabber.org/streams" from="cnexion.com" authid="bcb2256a" sid="bcb2256a" secure="true" requests="2" inactivity="30" polling="5" wait="60">stream:features<mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">DIGEST-MD5PLAINANONYMOUSCRAM-MD5<compression xmlns="http://jabber.org/features/compress">zlib<bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/>/stream:features SENT: <?xml version="1.0" encoding="UTF-8"?> <body xmlns=" http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1122203498" xml:lang="en" sid="bcb2256a"><auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="DIGEST-MD5"/> RECV:: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cmVhbG09ImNuZXhpb24uY29tIixub25jZT0ieFBtZnFjZUdPY0tOSXkycnY3S0c0UzRKT0RvMEtQSVB2YU5jMVdFSyIscW9wPSJhdXRoIixjaGFyc2V0PXV0Zi04LGFsZ29yaXRobT1tZDUtc2Vzcw==

Thanks, Akhilesh

On Mon, Jul 21, 2014 at 5:36 PM, Michael Weibel notifications@github.com wrote:

@akhileshpv https://github.com/akhileshpv could you show us by comparison a log from the failed login generated by the prebind lib?

— Reply to this email directly or view it on GitHub https://github.com/candy-chat/xmpp-prebind-php/issues/6#issuecomment-49597555 .

AKHILESH PV Sr. Software Engineer Phone: +91 484 4054324 | akhilesh@cubettech.com

[image: http://cubettech.com/] http://cubettech.com/

AKHILESH PV Sr. Software Engineer Phone: +91 484 4054324 | akhilesh@cubettech.com

[image: http://cubettech.com/] http://cubettech.com/

mweibel commented 10 years ago

sorry, which one is now the log from the php lib and which one is from Candy?

// Edit: please format them as code btw

akhileshpv commented 10 years ago

Hi Michael,

These all are from xmpp-prebind-php library with different encryption used.

Thanks, Akhilesh

mweibel commented 10 years ago

Ok. So the first and the 2nd seem to successfully authenticate. The first one then receives a conflict upon binding the Resource.

Could you show the code you use?

akhileshpv commented 10 years ago

Hi Michael,

This is the code we used for fetch session info.

require_once './prebind/lib/XmppPrebind.php'; $xmppPrebind = new XmppPrebind('cnexion.com', 'http://cnexion.com:5280/http-bind/', 'Candy', false, true); $xmppPrebind->connect('akhilesh', 'akhilesh123'); $xmppPrebind->auth(); $sessionInfo = $xmppPrebind->auth();

Candy chat working fine in my case with using the login method Candy.Core.connect('jid', 'password'). I need to use the Candy.Core.attach(jid, sid, rid) for HTTP pre-binding for manage sessions. Otherwise, in candy chat, we need to login every page refresh.

Thanks, Akhilesh

mweibel commented 10 years ago

What happens if you change the Resource in the new XmppPrebind call from Candy to something else?

akhileshpv commented 10 years ago

Hi Michael,

I have used the Resource 'Wsite' instead of 'Candy'. But I got the same response. Now I used the DIGEST-MD5 encryption. The console loge is

SENT: <?xml version="1.0" encoding="UTF-8"?> RECV:: stream:featuresDIGEST-MD5PLAINANONYMOUSCRAM-MD5zlib/stream:features sid: 11c8c5cd encryption used: DIGEST-MD5 SENT: <?xml version="1.0" encoding="UTF-8"?> RECV:: cmVhbG09ImNuZXhpb24uY29tIixub25jZT0iQURadm8rcWRIdzE3cEpPaCtPMVNCSmZLNy9SS3NhVHhJOElvRUI3RCIscW9wPSJhdXRoIixjaGFyc2V0PXV0Zi04LGFsZ29yaXRobT1tZDUtc2Vzcw== DIGEST-MD5 Auth String: username="akhilesh",realm="cnexion.com",nonce="ADZvo+qdHw17pJOh+O1SBJfK7/RKsaTxI8IoEB7D",cnonce="18XVOL+u+jn2vyz854/RvYbWXgu3eKDQU6JsuiYRTWw=",nc=00000001,qop=auth,digest-uri="xmpp/cnexion.com",response=0584efe3e7c14c636f2f50a54b304d26,maxbuf=65536 SENT: <?xml version="1.0" encoding="UTF-8"?> dXNlcm5hbWU9ImFraGlsZXNoIixyZWFsbT0iY25leGlvbi5jb20iLG5vbmNlPSJBRFp2bytxZEh3MTdwSk9oK08xU0JKZks3L1JLc2FUeEk4SW9FQjdEIixjbm9uY2U9IjE4WFZPTCt1K2puMnZ5ejg1NC9SdlliV1hndTNlS0RRVTZKc3VpWVJUV3c9IixuYz0wMDAwMDAwMSxxb3A9YXV0aCxkaWdlc3QtdXJpPSJ4bXBwL2NuZXhpb24uY29tIixyZXNwb25zZT0wNTg0ZWZlM2U3YzE0YzYzNmYyZjUwYTU0YjMwNGQyNixtYXhidWY9NjU1MzY= RECV:: cnNwYXV0aD04ZTE2MzU3YjA2N2ExMGZiMmM0NmJkYjJhZDRhYjJjMw== SENT: <?xml version="1.0" encoding="UTF-8"?> RECV::

Also the error report is Fatal error: Uncaught exception 'XmppPrebindException' with message 'Invalid login' in /home/dev001/projects/cnexion/candy/example/prebind/lib/XmppPrebind.php:188 Stack trace: #0 /home/dev001/projects/cnexion/candy/example/index.php(9): XmppPrebind->auth() #1 {main} thrown in /home/dev001/projects/cnexion/candy/example/prebind/lib/XmppPrebind.php on line 188

Do we need modify any configuration in openfire or server side?

Thanks, Akhielsh

akhileshpv commented 10 years ago

Hi Michael,

I got the Session Information from server when I try the same code with PLAIN encryption. Below I included my full code. Can you please look at this and let me know if anything is wrong? Because, when I have passed the JID, SID and RID in the method Candy.Core.attach(jid, sid, rid), I got the authentication error "Authentication failed".

    session_start();
    if(empty($_SESSION['sessionInfo'])){
        require_once './prebind/lib/XmppPrebind.php';

        $xmppPrebind = new XmppPrebind('cnexion.com', 'http://cnexion.com:5280/http-bind/', 'Candy', false, true);
        $xmppPrebind->connect('akhilesh', 'akhilesh123');
        $xmppPrebind->auth();
        $sessionInfo = $xmppPrebind->getSessionInfo();

        $_SESSION['sessionInfo'] = $sessionInfo;
    }else{
        $sessionInfo = $_SESSION['sessionInfo'];
    }
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Candy - Chats are not dead yet</title>
    <link rel="shortcut icon" href="../res/img/favicon.png" type="image/gif" />
    <link rel="stylesheet" type="text/css" href="../res/default.css" />

    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script type="text/javascript" src="../libs/libs.min.js"></script>
    <script type="text/javascript" src="../candy.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            Candy.init('http://cnexion.com:5280/http-bind/', {
                core: {
                    debug: true,
                    autojoin: ['cnexion@conference.cnexion.com']
                },
                view: { assets: '../res/' }
            });
            Candy.Core.connect('<?php echo $sessionInfo['jid']; ?>', '<?php echo $sessionInfo['sid']; ?>', '<?php echo $sessionInfo['rid']; ?>');
        });
    </script>
</head>
<body>
    <div id="candy"></div>
</body>
</html>

Thanks, Akhilesh

mweibel commented 10 years ago

You need to do Candy.Core.attach(jid, sid, rid), not connect

akhileshpv commented 10 years ago

Hi Michael,

Thank you... Its working.

But one another problem. Actually my aim is to keep the session once the user logged in candy chat. So I have saved the session info in php session variable ($_SESSION['sessionInfo'] = $sessionInfo;) and try to reuse it. But I got the error message "Invalid SID" when use the saved session info in another page load.

Can you please suggest me a solution for keep the candy chat session in every page load? Because the candy chat shows all pages in my application (Web site).

Thanks, Akhilesh

akhileshpv commented 10 years ago

Hi Michael,

Can you please give me an idea to reuse the session in candy chat on every page load?

Thanks, Akhilesh

mweibel commented 10 years ago

Please don't post the same question twice.

Candy uses the event beforeunload to disconnect the client. Therefore it might happen that the user is being logged out once you change the page. Try set disableWindowUnload to true in the core options and see how this goes. As always, if you need help, please post apropriate debug output from Candy.

MilesPong commented 10 years ago

Hi @mweibel @akhileshpv , Now I'm facing the same problem with @akhileshpv , the web shows me "Uncaught exception 'XmppPrebindException' with message 'Invalid login'." while I using the DIGEST-MD5 encryption, but shows "Invalid challenge response received" using CRAM_MD5 encryption. PLAIN encryption is Ok for me.

FYI, I use Openfire/converse.js, as @akhileshpv said, do we need to modify any configuration in openfire or anything I setup is wrong? (Sorry for I can't format the code)

require(['converse'], function (converse) { converse.initialize({ prebind: true, debug: true, bosh_service_url: 'http://doamin.com/http-bind/', jid: "<?=$sessionInfo['jid']; ?>", sid: "<?=$sessionInfo['sid']; ?>", rid: "<?=$sessionInfo['rid']; ?>",
auto_list_rooms: true, auto_subscribe: false, hide_muc_server: false, i18n: locales.en, // Refer to ./locale/locales.js to see which locales are supported show_controlbox_by_default: true, xhr_user_search: false }); });

Thanks, Miles

mweibel commented 10 years ago

As always, please send debug infos, otherwise I'm unable to help.

MilesPong commented 10 years ago

my page code:

<?php
session_start();
    if(empty($_SESSION['sessionInfo'])){
    require './lib/XmppPrebind.php';
    $xmppPrebind = new XmppPrebind('210.184.xxx.xx', 'http://210.184.xxx.xx:7070/http-bind/', '', false, true);
    $xmppPrebind->connect('miles', '916218');
    $xmppPrebind->auth();
    $sessionInfo = $xmppPrebind->getSessionInfo(); // array containing sid, rid and jid
    $_SESSION['sessionInfo'] = $sessionInfo;
    //print_r($sessionInfo);exit;
    }else{
        $sessionInfo = $_SESSION['sessionInfo'];
    }      
?>
<!DOCTYPE html>
...
require(['converse'], function (converse) { 
    converse.initialize({
        prebind: true,
        debug: true,
        bosh_service_url: 'http://210.184.xxx.xx:7070/http-bind/', //didn't have a domain
        jid: "<?=$sessionInfo['jid']; ?>",
        sid: "<?=$sessionInfo['sid']; ?>",
        rid: "<?=$sessionInfo['rid']; ?>",       
        auto_list_rooms: true,
        auto_subscribe: false,
        hide_muc_server: false,
        i18n: locales.en, // Refer to ./locale/locales.js to see which locales are supported
        show_controlbox_by_default: true,
        xhr_user_search: false
    });
});

The console logs as following, 1:Using DIGEST_MD5 encryption(always waiting for a long time, 1 min),no console logs but throw Exceptions,

 Fatal error: Uncaught exception 'XmppPrebindException' with message 'Invalid login' in /home/miles/workspace/php/converse/converse/lib/XmppPrebind.php on line 172
( ! ) XmppPrebindException: Invalid login in /home/miles/workspace/php/converse/converse/lib/XmppPrebind.php on line 172

2:Using CRAM_MD5 encryption(in normal loading speed), still no console logs,

( ! ) Fatal error: Uncaught exception 'XmppPrebindConnectionException' with message 'Invalid challenge response received' in /home/miles/workspace/php/converse/converse/lib/XmppPrebind.php on line 417
( ! ) XmppPrebindConnectionException: Invalid challenge response received in /home/miles/workspace/php/converse/converse/lib/XmppPrebind.php on line 417

3:Using PLAIN encryption,about several seconds refresh the page 1) The 1st time loading page(open in a )

Attached converse.min.js:163
0 _throttledRequestHandler called with 0 requests converse.min.js:163
0 _throttledRequestHandler called with 0 requests converse.min.js:163
Attr.specified is deprecated. Its value is always true. converse.min.js:163
0 _throttledRequestHandler called with 0 requests converse.min.js:163
0 request id 1.0 posting converse.min.js:163
0 request id 1.0 state changed to 1 converse.min.js:163
<body rid=​"1196154540" xmlns=​"http:​/​/​jabber.org/​protocol/​httpbind" sid=​"c8c2c626">​
<iq from=​"miles@210.184.xxx.xx/​" to=​"210.184.xxx.xx" type=​"get" xmlns=​"jabber:​client" id=​"7694:​sendIQ">​…​</iq>​
<iq from=​"miles@210.184.xxx.xx/​" to=​"210.184.xxx.xx" type=​"get" xmlns=​"jabber:​client" id=​"7695:​sendIQ">​…​</iq>​
<iq type=​"get" id=​"7696:​roster" xmlns=​"jabber:​client">​…​</iq>​
</body>​
 converse.min.js:163
Uncaught TypeError: boolean is not a function VM121:1
event.returnValue is deprecated. Please use the standard event.preventDefault() instead. 

2) The 2nd time loading page,

Attached converse.min.js:163
0 _throttledRequestHandler called with 0 requests converse.min.js:163
0 _throttledRequestHandler called with 0 requests converse.min.js:163
Attr.specified is deprecated. Its value is always true. converse.min.js:163
0 _throttledRequestHandler called with 0 requests converse.min.js:163
Uncaught TypeError: boolean is not a function VM320:1
0 request id 1.0 posting converse.min.js:163
0 request id 1.0 state changed to 1 converse.min.js:163
<body rid=​"1196154540" xmlns=​"http:​/​/​jabber.org/​protocol/​httpbind" sid=​"c8c2c626">​
<iq from=​"miles@210.184.xxx.xx/​" to=​"210.184.xxx.xx" type=​"get" xmlns=​"jabber:​client" id=​"3217:​sendIQ">​…​</iq>​
<iq from=​"miles@210.184.xxx.xx/​" to=​"210.184.xxx.xx" type=​"get" xmlns=​"jabber:​client" id=​"3218:​sendIQ">​…​</iq>​
<iq type=​"get" id=​"3219:​roster" xmlns=​"jabber:​client">​…​</iq>​
</body>​
 converse.min.js:163
0 request id 1.1 state changed to 2 converse.min.js:163
0 request id 1.1 state changed to 3 converse.min.js:163
0 request id 1.1 state changed to 4 converse.min.js:163
0 removing request converse.min.js:163
0 _throttledRequestHandler called with 0 requests converse.min.js:163
0 request id 1 should now be removed converse.min.js:163
0 request id 1.1 got 200 converse.min.js:163
<body xmlns=​"http:​/​/​jabber.org/​protocol/​httpbind">​</body>​
 converse.min.js:163
1 no requests during idle cycle, sending blank request converse.min.js:163
0 request id 2.0 posting converse.min.js:163
0 request id 2.0 state changed to 1 converse.min.js:163
<body rid=​"1196154541" xmlns=​"http:​/​/​jabber.org/​protocol/​httpbind" sid=​"c8c2c626">​</body>​
 converse.min.js:163

3) The 3rd time loading page,

Attached converse.min.js:163
0 _throttledRequestHandler called with 0 requests converse.min.js:163
0 _throttledRequestHandler called with 0 requests converse.min.js:163
Attr.specified is deprecated. Its value is always true. converse.min.js:163
0 _throttledRequestHandler called with 0 requests converse.min.js:163
Uncaught TypeError: boolean is not a function VM463:1
0 request id 1.0 posting converse.min.js:163
0 request id 1.0 state changed to 1 converse.min.js:163
<body rid=​"1196154540" xmlns=​"http:​/​/​jabber.org/​protocol/​httpbind" sid=​"c8c2c626">​
<iq from=​"miles@210.184.xxx.xx/​" to=​"210.184.xxx.xx" type=​"get" xmlns=​"jabber:​client" id=​"8997:​sendIQ">​…​</iq>​
<iq from=​"miles@210.184.xxx.xx/​" to=​"210.184.xxx.xx" type=​"get" xmlns=​"jabber:​client" id=​"8998:​sendIQ">​…​</iq>​
<iq type=​"get" id=​"8999:​roster" xmlns=​"jabber:​client">​…​</iq>​
</body>​
 converse.min.js:163
0 request id 1.1 state changed to 2 converse.min.js:163
0 request id 1.1 state changed to 3 converse.min.js:163
0 request id 1.1 state changed to 4 converse.min.js:163
0 removing request converse.min.js:163
0 _throttledRequestHandler called with 0 requests converse.min.js:163
0 request id 1 should now be removed converse.min.js:163
0 request id 1.1 got 200 converse.min.js:163
<body xmlns=​"http:​/​/​jabber.org/​protocol/​httpbind">​</body>​
 converse.min.js:163
1 no requests during idle cycle, sending blank request converse.min.js:163
0 request id 2.0 posting converse.min.js:163
0 request id 2.0 state changed to 1 converse.min.js:163
<body rid=​"1196154541" xmlns=​"http:​/​/​jabber.org/​protocol/​httpbind" sid=​"c8c2c626">​</body>​
 converse.min.js:163
0 request id 2.1 state changed to 2 converse.min.js:163
0 request id 2.1 state changed to 3 converse.min.js:163
0 request id 2.1 state changed to 4 converse.min.js:163
0 removing request converse.min.js:163
0 _throttledRequestHandler called with 0 requests converse.min.js:163
0 request id 2 should now be removed converse.min.js:163
0 request id 2.1 got 200 converse.min.js:163
<body xmlns=​"http:​/​/​jabber.org/​protocol/​httpbind">​</body>​
 converse.min.js:163
1 no requests during idle cycle, sending blank request converse.min.js:163
0 request id 3.0 posting converse.min.js:163
0 request id 3.0 state changed to 1 converse.min.js:163
<body rid=​"1196154542" xmlns=​"http:​/​/​jabber.org/​protocol/​httpbind" sid=​"c8c2c626">​</body>​
 converse.min.js:163
event.returnValue is deprecated. Please use the standard event.preventDefault() instead. 

4) The 4th time loading page(404 (Not Found))

Attached converse.min.js:163
0 _throttledRequestHandler called with 0 requests converse.min.js:163
0 _throttledRequestHandler called with 0 requests converse.min.js:163
Attr.specified is deprecated. Its value is always true. converse.min.js:163
0 _throttledRequestHandler called with 0 requests converse.min.js:163
Uncaught TypeError: boolean is not a function VM588:1
0 request id 1.0 posting converse.min.js:163
0 request id 1.0 state changed to 1 converse.min.js:163
<body rid=​"1196154540" xmlns=​"http:​/​/​jabber.org/​protocol/​httpbind" sid=​"c8c2c626">​…​</body>​
 converse.min.js:163
POST http://210.184.xxx.xx:7070/http-bind/ 404 (Not Found) converse.min.js:163
0 request id 1.1 state changed to 2 converse.min.js:163
0 request id 1.1 state changed to 3 converse.min.js:163
0 request id 1.1 state changed to 4 converse.min.js:163
0 removing request converse.min.js:163
0 _throttledRequestHandler called with 0 requests converse.min.js:163
0 request id 1 should now be removed converse.min.js:163
ERROR: request id 1.1 error 404 happened converse.min.js:163
2 request errored, status: 404, number of errors: 1 converse.min.js:163
1 _doDisconnect was called converse.min.js:163
event.returnValue is deprecated. Please use the standard event.preventDefault() instead. 

5) The 5th time loading page(404 (Invalid SID.))

Attached converse.min.js:163
0 _throttledRequestHandler called with 0 requests converse.min.js:163
0 _throttledRequestHandler called with 0 requests converse.min.js:163
Attr.specified is deprecated. Its value is always true. converse.min.js:163
0 _throttledRequestHandler called with 0 requests converse.min.js:163
Uncaught TypeError: boolean is not a function VM686:1
0 request id 1.0 posting converse.min.js:163
0 request id 1.0 state changed to 1 converse.min.js:163
<body rid=​"1196154540" xmlns=​"http:​/​/​jabber.org/​protocol/​httpbind" sid=​"c8c2c626">​…​</body>​
 converse.min.js:163
POST http://210.184.xxx.xx:7070/http-bind/ 404 (Invalid SID.) converse.min.js:163
0 request id 1.1 state changed to 2 converse.min.js:163
0 request id 1.1 state changed to 3 converse.min.js:163
0 request id 1.1 state changed to 4 converse.min.js:163
0 removing request converse.min.js:163
0 _throttledRequestHandler called with 0 requests converse.min.js:163
0 request id 1 should now be removed converse.min.js:163
ERROR: request id 1.1 error 404 happened converse.min.js:163
2 request errored, status: 404, number of errors: 1 converse.min.js:163
1 _doDisconnect was called converse.min.js:163
event.returnValue is deprecated. Please use the standard event.preventDefault() instead. 

Thanks, Miles

mweibel commented 10 years ago

Could you paste the debug output of the XmppPrebind class?

MilesPong commented 10 years ago

@mweibel well I suggest you can just forget the console log, I finally got that rid should be unique while sending request every time.Now let me put this question more clear, 1, how to get the latest RID form server? 2, still about the type of encryption, only PLAIN is OK, the other 2 will return Exception as I said above (I have already set the debug mode in XmppPrebind, what else debug do u need?)

mweibel commented 10 years ago

1) you get the latest RID, but you need to increase it by one 2) the debug output you sent is from converse js, I need the one from XmppPrebind.

Also please note I'm not actively developing in PHP anymore, therefore please try to fix it on your own and send a PR.

douglasjam commented 9 years ago

I was with the same error, but at the moment I will use the plain mode, here is my xmpp debug:

send:

<?xml version="1.0" encoding="UTF-8"?>
<body xmlns="http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1108274429" xml:lang="en" hold="1" to="localhost" xmlns:xmpp="urn:xmpp:xbosh" xmpp:version="1.0" wait="60"/>

recv:

<body xmlns="http://jabber.org/protocol/httpbind" xmlns:stream="http://etherx.jabber.org/streams" from="basis-bh-112" authid="d00e8c8" sid="d00e8c8" secure="true" requests="2" inactivity="30" polling="5" wait="60"><stream:features><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>CRAM-MD5</mechanism></mechanisms><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/></stream:features></body>

sid:

d00e8c8

encryption used:

DIGEST-MD5

send:

<?xml version="1.0" encoding="UTF-8"?>
<body xmlns="http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1108274430" xml:lang="en" sid="d00e8c8"><auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="DIGEST-MD5"/></body>

recv:

<body xmlns='http://jabber.org/protocol/httpbind'><challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cmVhbG09ImJhc2lzLWJoLTExMiIsbm9uY2U9IlRxaTJVRm55Z3JDVy9MczMreG90TWdoNzhicTMrRUExS1VLY3NuTXIiLHFvcD0iYXV0aCIsY2hhcnNldD11dGYtOCxhbGdvcml0aG09bWQ1LXNlc3M=</challenge></body>

digest-md5 auth string:

username="douglas",realm="basis-bh-112",nonce="Tqi2UFnygrCW/Ls3+xotMgh78bq3+EA1KUKcsnMr",cnonce="S4MH1V51GPg4Xt4+aKYWFRI4+xmDC3OYgtDTfDrwYV8=",nc=00000001,qop=auth,digest-uri="xmpp/localhost",response=ac495ff83e363711f26b2bf7dd1206e3,maxbuf=65536

sent:

<?xml version="1.0" encoding="UTF-8"?>
<body xmlns="http://jabber.org/protocol/httpbind" content="text/xml charset=utf-8" rid="1108274431" xml:lang="en" sid="d00e8c8"><response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dXNlcm5hbWU9ImRvdWdsYXMiLHJlYWxtPSJiYXNpcy1iaC0xMTIiLG5vbmNlPSJUcWkyVUZueWdyQ1cvTHMzK3hvdE1naDc4YnEzK0VBMUtVS2Nzbk1yIixjbm9uY2U9IlM0TUgxVjUxR1BnNFh0NCthS1lXRlJJNCt4bURDM09ZZ3REVGZEcndZVjg9IixuYz0wMDAwMDAwMSxxb3A9YXV0aCxkaWdlc3QtdXJpPSJ4bXBwL2xvY2FsaG9zdCIscmVzcG9uc2U9YWM0OTVmZjgzZTM2MzcxMWYyNmIyYmY3ZGQxMjA2ZTMsbWF4YnVmPTY1NTM2</response></body>

recv:

<body xmlns='http://jabber.org/protocol/httpbind'><failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/></failure></body>

Invalid challenge response received