login fails in chatrooms but works on login page

3 views
Skip to first unread message

vetetix

unread,
Jun 28, 2009, 10:45:09 PM6/28/09
to speeqe
Hi all,

On my own installation of Speeqe, the login works on the login page
(http://mysite.com/accounts/login), but fails when joining a chatroom
or when "changing user" inside a chatroom (ejabberd's logs give me an
"Accepted authentication" in the first case, and a "Failed
authentication" in the second).

Anonymous login (with random username and accounts) work fine on my
setup. Also, I've tried to use sqlite and mysql to test different
situations, but it didn't change anything.

What can I do to track and tackle the problem?

Chad Selph

unread,
Jun 29, 2009, 12:42:36 AM6/29/09
to spe...@googlegroups.com
The login on the login page does all the xmpp server side (I think).
On the chat rooms it uses BOSH to yourserver.com/http-xmpp (or
whatever you set it as).

I would guess that there's a problem with your proxy settings, are you
proxying a /path to punjab or ejabberd's mod-http?

Thomas Arnoux

unread,
Jun 29, 2009, 8:20:52 AM6/29/09
to spe...@googlegroups.com
Le dimanche 28 juin 2009 à 21:42 -0700, Chad Selph a écrit :
> The login on the login page does all the xmpp server side (I think).
> On the chat rooms it uses BOSH to yourserver.com/http-xmpp (or
> whatever you set it as).

I have to admit that I don't exactly know how all this stuff works, it
is all black magic to me :D

I previously tried to use only ejabberd's mod_http_bind, it worked
perfectly for the anonymous part, but speeqe gave me errors asking for
punjab when i tried to authenticate, so now i've installed punjab.

> I would guess that there's a problem with your proxy settings, are you
> proxying a /path to punjab or ejabberd's mod-http?

I'm using the exact configuration given on the speeqesetup page (using
the "upstream punjab" stuff). I only put it port 5281, because 5280 is
the default port for ejabberd's admin. When I go to
myserver.com/xmpp_httpbind, I get a response from punjab.

I also deactivated ejabberd's own BOSH provider, to be sure there are no
interferences.

--
Thomas

Chad Selph

unread,
Jun 29, 2009, 12:08:11 PM6/29/09
to spe...@googlegroups.com
You might want to try using the basic examples that come with Strophe
to test that Punjab is working.

vetetix

unread,
Jun 29, 2009, 1:41:42 PM6/29/09
to speeqe
> You might want to try using the basic examples that come with Strophe
> to test that Punjab is working.

I've just tried those examples (basic and echobot), it seems they
don't work either. They connect to the server, and then the
authentication fails.

Could there be some link with a tls/ssl/sha/md5/other error? When I
start punjab, I get a deprecation warning:

root@myserver:/srv/punjab# twistd -y punjab.tac
/usr/local/lib/python2.6/dist-packages/punjab/httpb.py:16:
DeprecationWarning: the sha module is deprecated; use the hashlib
module instead
import sha, time
/usr/local/lib/python2.6/dist-packages/punjab/session.py:18:
DeprecationWarning: the md5 module is deprecated; use hashlib instead
import md5

Christopher Zorn

unread,
Jun 29, 2009, 1:49:07 PM6/29/09
to spe...@googlegroups.com

What is your BOSH url? Are you doing a proxy? It does not look like you are hitting punjab.

 


vetetix

unread,
Jun 29, 2009, 2:00:12 PM6/29/09
to speeqe
> What is your BOSH url? Are you doing a proxy? It does not look like you are
> hitting punjab.

- My xmpp server's dns is arnoux.lu
- The speeqe website is http://salons.arnoux.lu
- The BOSH url is http://salons.arnoux.lu/xmpp-httpbind/
- nginx's configuration regarding bosh is as follow:

upstream punjab {
server localhost:5281;
}

server {
[...]
location /xmpp-httpbind {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://punjab;

}
[...]
}

Christopher Zorn

unread,
Jun 29, 2009, 2:09:23 PM6/29/09
to spe...@googlegroups.com
On Mon, Jun 29, 2009 at 2:00 PM, vetetix <vet...@gmail.com> wrote:

> What is your BOSH url? Are you doing a proxy? It does not look like you are
> hitting punjab.

- My xmpp server's dns is arnoux.lu
- The speeqe website is http://salons.arnoux.lu
- The BOSH url is http://salons.arnoux.lu/xmpp-httpbind/
- nginx's configuration regarding bosh is as follow:

upstream punjab {
   server localhost:5281;
}

It looks like it is doing the proxy correctly. You may want to turn verbose logging on in the punjab.tac file.

Just add  a 1 or True to the service init.

b = resource.IResource(HttpbService(1))

You can then post the logs here.

Actually, I just went to http://salons.arnoux.lu/room/test/ and it worked!


 

vetetix

unread,
Jun 29, 2009, 2:22:43 PM6/29/09
to speeqe
> Actually, I just went to http://salons.arnoux.lu/room/test/and it worked!

Yes, the anonymous part (with creation of random accounts in ejabberd)
does work quite well. It's the authenticated part that is problematic.

> It looks like it is doing the proxy correctly. You may want to turn verbose
> logging on in the punjab.tac file.
>
> You can then post the logs here.

Here they are (sorry for the spam):

2009-06-29 20:14:12+0200 [-] Log opened.
2009-06-29 20:14:12+0200 [-] twistd 8.2.0 (/usr/bin/python 2.6.2)
starting up.
2009-06-29 20:14:12+0200 [-] reactor class:
twisted.internet.selectreactor.SelectReactor.
2009-06-29 20:14:12+0200 [-] twisted.web.server.Site starting on 5281
2009-06-29 20:14:12+0200 [-] Starting factory <twisted.web.server.Site
instance at 0x881580c>
2009-06-29 20:14:33+0200 [HTTPChannel,0,127.0.0.1] HEADERS
1246299273.53:
2009-06-29 20:14:33+0200 [HTTPChannel,0,127.0.0.1] {'content-length':
'217', 'accept-language': 'en-us,en;q=0.5', 'accept-encoding':
'gzip,deflate', 'x-forwarded-for': '83.222.33.35', 'connection':
'close', 'accept': 'text/html,application/xhtml+xml,application/
xml;q=0.9,*/*;q=0.8', 'user-agent': 'Mozilla/5.0 (X11; U; Linux i686;
en-US; rv:1.9.1) Gecko/20090622 Ubuntu/9.04 (jaunty) Shiretoko/3.5',
'accept-charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'host':
'salons.arnoux.lu', 'referer': 'http://salons.arnoux.lu/
speeqewebclient/scripts/examples/basic.html', 'pragma': 'no-cache',
'cache-control': 'no-cache', 'x-real-ip': '83.222.33.35', 'cookie':
'sessionid=0832fc2932edbbe87178132bda71e2d8;
sessionid=e3d44b1a48fdb7e853bb44da010ba4ae', 'content-type': 'text/
plain; charset=UTF-8'}
2009-06-29 20:14:33+0200 [HTTPChannel,0,127.0.0.1] HTTPB POST :
2009-06-29 20:14:33+0200 [HTTPChannel,0,127.0.0.1] <body
rid='311999972' xmlns='http://jabber.org/protocol/httpbind'
to='arnoux.lu' xml:lang='en' wait='60' hold='1' window='5'
content='text/xml; charset=utf-8' ver='1.6' xmpp:version='1.0'
xmlns:xmpp='urn:xmpp:xbosh'/>
2009-06-29 20:14:33+0200 [HTTPChannel,0,127.0.0.1] Session Created :
f7d9bd784547ef353b2ff2359acbea5d 1246299273.53
2009-06-29 20:14:33+0200 [HTTPChannel,0,127.0.0.1]
================================== 1246299273.53 connect to arnoux.lu:
5222 ==================================
2009-06-29 20:14:33+0200 [HTTPChannel,0,127.0.0.1] Starting factory
<punjab.session.Session object at 0x896c6ac>
2009-06-29 20:14:33+0200 [HTTPChannel,0,127.0.0.1] /etc/resolv.conf
changed, reparsing
2009-06-29 20:14:33+0200 [HTTPChannel,0,127.0.0.1] Resolver added
('217.70.184.225', 53) to server list
2009-06-29 20:14:33+0200 [HTTPChannel,0,127.0.0.1] Resolver added
('217.70.184.227', 53) to server list
2009-06-29 20:14:33+0200 [HTTPChannel,0,127.0.0.1] <class
'twisted.names.dns.DNSDatagramProtocol'> starting on 34787
2009-06-29 20:14:33+0200 [HTTPChannel,0,127.0.0.1] Starting protocol
<twisted.names.dns.DNSDatagramProtocol object at 0x89737ec>
2009-06-29 20:14:33+0200 [-] (Port 34787 Closed)
2009-06-29 20:14:33+0200 [-] Stopping protocol
<twisted.names.dns.DNSDatagramProtocol object at 0x89737ec>
2009-06-29 20:14:33+0200 [Uninitialized] SID:
f7d9bd784547ef353b2ff2359acbea5d => SEND: <stream:stream
xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client'
to='arnoux.lu' version='1.0'>
2009-06-29 20:14:33+0200 [XmlStream,client] SID:
f7d9bd784547ef353b2ff2359acbea5d => RECV: <?xml version='1.0'?
><stream:stream xmlns='jabber:client' xmlns:stream='http://
etherx.jabber.org/streams' id='3031473580' from='arnoux.lu'
version='1.0' xml:lang='en'><stream:features><starttls
xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms
xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>ANONYMOUS</
mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</
mechanism></mechanisms><register xmlns='http://jabber.org/features/iq-
register'/></stream:features>
2009-06-29 20:14:33+0200 [XmlStream,client] SID:
f7d9bd784547ef353b2ff2359acbea5d => SEND: <starttls
xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
2009-06-29 20:14:33+0200 [XmlStream,client] SID:
f7d9bd784547ef353b2ff2359acbea5d => RECV: <proceed
xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
2009-06-29 20:14:33+0200 [XmlStream,client] SID:
f7d9bd784547ef353b2ff2359acbea5d => SEND: <stream:stream
xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client'
to='arnoux.lu' version='1.0'>
2009-06-29 20:14:33+0200 [XmlStream,client] SID:
f7d9bd784547ef353b2ff2359acbea5d => RECV: <?xml version='1.0'?
><stream:stream xmlns='jabber:client' xmlns:stream='http://
etherx.jabber.org/streams' id='223072775' from='arnoux.lu'
version='1.0' xml:lang='en'>
2009-06-29 20:14:33+0200 [XmlStream,client] SID:
f7d9bd784547ef353b2ff2359acbea5d => RECV: <stream:features><mechanisms
xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>ANONYMOUS</
mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</
mechanism></mechanisms><register xmlns='http://jabber.org/features/iq-
register'/></stream:features>
2009-06-29 20:14:33+0200 [XmlStream,client]

RETURN HTTPB 1246299273.63:
2009-06-29 20:14:33+0200 [XmlStream,client] <body xmlns='http://
jabber.org/protocol/httpbind' inactivity='60' secure='true'
authid='3031473580' content='text/xml; charset=utf-8' window='5'
polling='15' sid='f7d9bd784547ef353b2ff2359acbea5d' requests='2'
wait='60'><stream:features xmlns:stream='http://etherx.jabber.org/
streams' xmlns='jabber:client'><mechanisms
xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>ANONYMOUS</
mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</
mechanism></mechanisms><register xmlns='http://jabber.org/features/iq-
register'/></stream:features></body>
2009-06-29 20:14:33+0200 [XmlStream,client] 127.0.0.1 - - [29/Jun/
2009:18:14:33 +0000] "POST /xmpp-httpbind HTTP/1.0" 200 549 "http://
salons.arnoux.lu/speeqewebclient/scripts/examples/basic.html" "Mozilla/
5.0 (X11; U; Linux i686; en-US; rv:1.9.1) Gecko/20090622 Ubuntu/9.04
(jaunty) Shiretoko/3.5"
2009-06-29 20:14:33+0200 [HTTPChannel,1,127.0.0.1] HEADERS
1246299273.91:
2009-06-29 20:14:33+0200 [HTTPChannel,1,127.0.0.1] {'content-length':
'183', 'accept-language': 'en-us,en;q=0.5', 'accept-encoding':
'gzip,deflate', 'x-forwarded-for': '83.222.33.35', 'connection':
'close', 'accept': 'text/html,application/xhtml+xml,application/
xml;q=0.9,*/*;q=0.8', 'user-agent': 'Mozilla/5.0 (X11; U; Linux i686;
en-US; rv:1.9.1) Gecko/20090622 Ubuntu/9.04 (jaunty) Shiretoko/3.5',
'accept-charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'host':
'salons.arnoux.lu', 'referer': 'http://salons.arnoux.lu/
speeqewebclient/scripts/examples/basic.html', 'pragma': 'no-cache',
'cache-control': 'no-cache', 'x-real-ip': '83.222.33.35', 'cookie':
'sessionid=0832fc2932edbbe87178132bda71e2d8;
sessionid=e3d44b1a48fdb7e853bb44da010ba4ae', 'content-type': 'text/
plain; charset=UTF-8'}
2009-06-29 20:14:33+0200 [HTTPChannel,1,127.0.0.1] HTTPB POST :
2009-06-29 20:14:33+0200 [HTTPChannel,1,127.0.0.1] <body
rid='311999973' xmlns='http://jabber.org/protocol/httpbind'
sid='f7d9bd784547ef353b2ff2359acbea5d'><auth
xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='DIGEST-MD5'/></
body>
2009-06-29 20:14:33+0200 [HTTPChannel,1,127.0.0.1] 311999973
2009-06-29 20:14:33+0200 [HTTPChannel,1,127.0.0.1] SID:
f7d9bd784547ef353b2ff2359acbea5d => SEND: <auth
xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='DIGEST-MD5'/>
2009-06-29 20:14:33+0200 [XmlStream,client] SID:
f7d9bd784547ef353b2ff2359acbea5d => RECV: <challenge
xmlns='urn:ietf:params:xml:ns:xmpp-
sasl'>bm9uY2U9IjMzNTcwOTUzODIiLHFvcD0iYXV0aCIsY2hhcnNldD11dGYtOCxhbGdvcml0aG09bWQ1LXNlc3M=</
challenge>
2009-06-29 20:14:33+0200 [XmlStream,client]

RETURN HTTPB 1246299273.91:
2009-06-29 20:14:33+0200 [XmlStream,client] <body xmlns='http://
jabber.org/protocol/httpbind'><challenge
xmlns='urn:ietf:params:xml:ns:xmpp-
sasl'>bm9uY2U9IjMzNTcwOTUzODIiLHFvcD0iYXV0aCIsY2hhcnNldD11dGYtOCxhbGdvcml0aG09bWQ1LXNlc3M=</
challenge></body>
2009-06-29 20:14:33+0200 [XmlStream,client] 311999973
2009-06-29 20:14:33+0200 [XmlStream,client] 127.0.0.1 - - [29/Jun/
2009:18:14:33 +0000] "POST /xmpp-httpbind HTTP/1.0" 200 205 "http://
salons.arnoux.lu/speeqewebclient/scripts/examples/basic.html" "Mozilla/
5.0 (X11; U; Linux i686; en-US; rv:1.9.1) Gecko/20090622 Ubuntu/9.04
(jaunty) Shiretoko/3.5"
2009-06-29 20:14:34+0200 [HTTPChannel,2,127.0.0.1] HEADERS
1246299274.22:
2009-06-29 20:14:34+0200 [HTTPChannel,2,127.0.0.1] {'content-length':
'430', 'accept-language': 'en-us,en;q=0.5', 'accept-encoding':
'gzip,deflate', 'x-forwarded-for': '83.222.33.35', 'connection':
'close', 'accept': 'text/html,application/xhtml+xml,application/
xml;q=0.9,*/*;q=0.8', 'user-agent': 'Mozilla/5.0 (X11; U; Linux i686;
en-US; rv:1.9.1) Gecko/20090622 Ubuntu/9.04 (jaunty) Shiretoko/3.5',
'accept-charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'host':
'salons.arnoux.lu', 'referer': 'http://salons.arnoux.lu/
speeqewebclient/scripts/examples/basic.html', 'pragma': 'no-cache',
'cache-control': 'no-cache', 'x-real-ip': '83.222.33.35', 'cookie':
'sessionid=0832fc2932edbbe87178132bda71e2d8;
sessionid=e3d44b1a48fdb7e853bb44da010ba4ae', 'content-type': 'text/
plain; charset=UTF-8'}
2009-06-29 20:14:34+0200 [HTTPChannel,2,127.0.0.1] HTTPB POST :
2009-06-29 20:14:34+0200 [HTTPChannel,2,127.0.0.1] <body
rid='311999974' xmlns='http://jabber.org/protocol/httpbind'
sid='f7d9bd784547ef353b2ff2359acbea5d'><response
xmlns='urn:ietf:params:xml:ns:xmpp-
sasl'>dXNlcm5hbWU9InRob21hcyIscmVhbG09IiIsbm9uY2U9IjMzNTcwOTUzODIiLGNub25jZT0iZDQxZDhjZDk4ZjAwYjIwNGU5ODAwOTk4ZWNmODQyN2UiLG5jPSIwMDAwMDAwMSIscW9wPSJhdXRoIixkaWdlc3QtdXJpPSJ4bXBwLyIscmVzcG9uc2U9ImMyMjg0ODFkOTQ0NWJmOGU1NTkwNzQ4OGNkMmRjY2VjIixjaGFyc2V0PSJ1dGYtOCI=</
response></body>
2009-06-29 20:14:34+0200 [HTTPChannel,2,127.0.0.1] 311999974
2009-06-29 20:14:34+0200 [HTTPChannel,2,127.0.0.1] SID:
f7d9bd784547ef353b2ff2359acbea5d => SEND: <response
xmlns='urn:ietf:params:xml:ns:xmpp-
sasl'>dXNlcm5hbWU9InRob21hcyIscmVhbG09IiIsbm9uY2U9IjMzNTcwOTUzODIiLGNub25jZT0iZDQxZDhjZDk4ZjAwYjIwNGU5ODAwOTk4ZWNmODQyN2UiLG5jPSIwMDAwMDAwMSIscW9wPSJhdXRoIixkaWdlc3QtdXJpPSJ4bXBwLyIscmVzcG9uc2U9ImMyMjg0ODFkOTQ0NWJmOGU1NTkwNzQ4OGNkMmRjY2VjIixjaGFyc2V0PSJ1dGYtOCI=</
response>
2009-06-29 20:14:34+0200 [XmlStream,client] SID:
f7d9bd784547ef353b2ff2359acbea5d => RECV: <failure
xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><not-authorized/></failure>
2009-06-29 20:14:34+0200 [XmlStream,client]

RETURN HTTPB 1246299274.22:
2009-06-29 20:14:34+0200 [XmlStream,client] <body xmlns='http://
jabber.org/protocol/httpbind'><failure
xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><not-authorized/></failure></
body>
2009-06-29 20:14:34+0200 [XmlStream,client] 311999974
2009-06-29 20:14:34+0200 [XmlStream,client] 127.0.0.1 - - [29/Jun/
2009:18:14:33 +0000] "POST /xmpp-httpbind HTTP/1.0" 200 134 "http://
salons.arnoux.lu/speeqewebclient/scripts/examples/basic.html" "Mozilla/
5.0 (X11; U; Linux i686; en-US; rv:1.9.1) Gecko/20090622 Ubuntu/9.04
(jaunty) Shiretoko/3.5"

vetetix

unread,
Jun 29, 2009, 2:27:00 PM6/29/09
to speeqe
Oh, btw, is it possible that the problem is linked to the storage of
the login/password in django's database that would fail? I tried to
check that out, but I couldn't quite figure out how the database was
used for that purpose, so I couldn't get to any conclusions.

Christopher Zorn

unread,
Jun 29, 2009, 2:47:57 PM6/29/09
to spe...@googlegroups.com


It could be this. You are going through auth correctly and it seems like the password is incorrect. Or something is not right with the way it is stored.
 



vetetix

unread,
Jun 29, 2009, 2:56:54 PM6/29/09
to speeqe
On Jun 29, 8:47 pm, Christopher Zorn <christopher.z...@gmail.com>
wrote:
What can i tweak to find an error in the database stuff? I allready
tried mysql and sqlite, but the behaviour is the same for both.
Reply all
Reply to author
Forward
0 new messages