When connecting with Python XMPP client get authentication failed - how to troubleshoot

Hi,

When I’m trying to connect using a python XMPP client I am getting an authentication failure (for an existing user).

I’m able to connect for the same user when using Spark.

I do not see any info in the /opt/openfire/logs. Is there a way to get more info or turn up the logging levels to see what is going on ?

Best Regards,

Richard

The python code is below:

===================

#!/usr/bin/python
import sys
import xmpp
import os
import signal
import time

def messageCB(conn,msg):
print "Sender: " + str(msg.getFrom())
print "Content: " + str(msg.getBody())
print msg

def StepOn(conn):
try:
conn.Process(1)
except KeyboardInterrupt:
return 0
return 1

def GoOn(conn):
while StepOn(conn):
pass

def main():

    jid="bob@test.com"
    pwd="bob"

jid=xmpp.protocol.JID(jid)

cl = xmpp.Client(jid.getDomain(), debug=[])

if cl.connect() == “”:
print "not connected"
sys.exit(0)

if cl.auth(jid.getNode(),pwd) == None:
print "authentication failed"
sys.exit(0)

    cl.RegisterHandler('message', messageCB)

#cl.sendInitPresence()

GoOn(cl)

main()

Hi,

[deletes bad info from my orig post]. remove the debug=[] part to turn on the debugging to the console for your client.

daryl

PS. While the learning curve is step, I highly recommend the twisted words xmpp library.

Thanks, after turning on the debugging the message exchange with the server is the below: (the user and password is ayisz and the domain is atg-a2m-1)

DEBUG: socket sent <?xml version='1.0'?><stream:stream version=‘1.0’ xmlns:stream=‘http://etherx.jabber.org/streams’ to=‘atg-a2m-1’ xmlns=‘jabber:client’>

DEBUG: socket got <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream=“http://etherx.jabber.org/streams” xmlns=“jabber:client” from=“atg-a2m-1” id=“dd8feeba” xml:lang=“en” version=“1.0”>stream:featuresDIGEST-MD5PLAINANONYMOUSCRAM-MD5</mech anism>zlib</stream:features>

DEBUG: socket sent
DEBUG: socket got

DEBUG: socket sent <?xml version='1.0'?><stream:stream version=‘1.0’ xmlns:stream=‘http://etherx.jabber.org/streams’ to=‘atg-a2m-1’ xmlns=‘jabber:client’>

DEBUG: socket got <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream=“http://etherx.jabber.org/streams” xmlns=“jabber:client” from=“atg-a2m-1” id=“dd8feeba” xml:lang=“en” version=“1.0”>stream:featuresDIGEST-MD5PLAINANONYMOUSCRAM-MD5</mech anism>zlib</stream:features>

DEBUG: socket sent
DEBUG: socket got cmVhbG09ImF0Zy1hMm0tMSIsbm9uY2U9IjBNZW gwVWFKVk9EZXFvYTc2bG42OW9jaHVVa21CL2xtYytRalpvY3UiLHFvcD0iYXV0aCIsY2hhcnNldD11dG YtOCxhbGdvcml0aG09bWQ1LXNlc3M=

DEBUG: socket sent Y2hhcnNldD11dGYtOCx1c2VybmFtZT0iYXlpc3 oiLHJlYWxtPSJhdGctYTJtLTEiLG5vbmNlPSIwTWVoMFVhSlZPRGVxb2E3NmxuNjlvY2h1VWttQi9sbW MrUWpab2N1IixuYz0wMDAwMDAwMSxjbm9uY2U9IjI5ZmY0YWU4YTJkOTlkNzVmZGJjMzM5OTBiMGJjND diYTM0MWQ0YjE5ODcxNDAzYiIsZGlnZXN0LXVyaT0ieG1wcC8iLHJlc3BvbnNlPWM3YTc2YjU3Y2IzNT EzM2QxYTAyNTFhNzVkODMxMDMxLHFvcD1hdXRo
DEBUG: socket got

DEBUG: socket sent ayisz

DEBUG: socket got ayisz<resource/ >

DEBUG: socket sent ayisz7d1e2b6ac3b2b83ac27906b7e670aba888f95aabxmpppy</re source>
DEBUG: socket got ayisz7d1e2b6ac3b 2b83ac27906b7e670aba888f95aabxmpppy