Registration not working with XIFF and Jive Messenger

Hi,

I sent this to Sean Voisen and he suggested that I post it on this forum so that others can help and it can be documented here as well.

Basically I’‘m trying to get Jive Messenger server to work with my existing code that is utilizing the XIFF library. The code was able to run using JabberD 1.4 and on Antepo’'s OPN server and I would like to give the Jive Server a try. I however, am running into problems with the XMPP registration process.

I have installed the Jive Server and have it up and running fine. But, I can’'t seem to get the XIFF library to create a new account on the server.

Here is the output of the XMPP exchange that is going on:

<?xml version="1.0"?> <?xml version=''1.0'' encoding=''UTF-8''?>

csa6

So, at this point I’m assuming, perhaps incorrectly that this error means the account can’t be found, and then I start up the registration process. With JabberD the error code for this was 404 “Not Found.”, and with OPN server it was always 401 “Unauthorized”

csa6@xmpptest.partners.org5bd98ab862059feae2cc6093fa884d4ce943903e

It then just hangs here forever.

Any idea what might be the problem? Let me know if you see anything that is obvious here.

Thanks,

Chris

I was using comments in the XML and those seemed to be stripped out when I posted it.

Perhaps this time it will work better as I made them non-valid comments:

Hi,

I sent this to Sean Voisen and he suggested that I

post it on this forum so that others can help and it

can be documented here as well.

Basically I’'m trying to get Jive Messenger server to

work with my existing code that is utilizing the XIFF

library. The code was able to run using JabberD 1.4

and on Antepo’'s OPN server and I would like to give

the Jive Server a try. I however, am running into

problems with the XMPP registration process.

I have installed the Jive Server and have it up and

running fine. But, I can’'t seem to get the XIFF

library to create a new account on the server.

Here is the output of the XMPP exchange that is going

on:

<?xml version="1.0"?><flash:stream

to=“xmpptest.partners.org” xmlns=“jabber:client”

xmlns:flash=“http://www.jabber.com/streams/flash

version=“1.0” />

<! – end →

<! – Output > <!Event : connection> <! end

<! – Recv Time:1112220452832 →

<?xml version=''1.0'' encoding=''UTF-8''?><flash:stream

xmlns:flash=“http://www.jabber.com/streams/flash

xmlns:stream=“http://etherx.jabber.org/streams

xmlns=“jabber:client” from=“xmpptest.partners.org

id=“77caa638” xml:lang=“en” />

<! – end →

<! – Sent →

<query

xmlns=“jabber:iq:auth”>csa6</quer

y>

<! – end →

<! – Recv Time:1112220455816 →

<! – end →

<! – Output > <!Event : error> <! end →

<! – Output > <!Error Code: 500> <! end →

<! – Output > <!Error Condition:

undefined-condition> <! end →

<! – Output > <!Error Message: Unknown Error–>

<! – end →

<! – Output > <!Error Type: modify> <! end

So, at this point I’m assuming, perhaps incorrectly

that this error means the account can’t be found, and

then I start up the registration process. With

JabberD the error code for this was 404 “Not Found.”,

and with OPN server it was always 401 “Unauthorized”

<! – Output > <!running the LoginManager

constructor> <! end →

<! – Output > <!running

LoginManager.register()> <! end →

<! – Sent →

<iq id=“reg_attempt_2” type=“set”

to=“xmpptest.partners.org”><query

xmlns=“jabber:iq:register”>csa6@xmpptest.par

tners.org5bd98ab862059feae2cc6093

fa884d4ce943903e

<! – end →

It then just hangs here forever.

Any idea what might be the problem? Let me know if

you see anything that is obvious here.

Thanks,

Chris

Hi Chris - If you’‘re trying to register a new account, when you connect you might want to leave the username property null in your XMPPConnection object. Then, the class will connect and call getRegistrationFields() automatically instead. Of course, if someone types in some invalid username, then I guess you can’'t really prevent that.

Not sure why it hangs though - I haven’‘t yet tried this myself. But, shouldn’'t the username value just be csa6 and not csa6@xmpptest.partners.org in the account registration fields?

Hey Chris,

Could you check the error log file? I guess that some exception has occurred so no answer was sent back to the client. Also, try using the latest nightly build which includes some minor fixes to the registration and authentication process.

Regards,

– Gato

Sean,

The reason that I am sending a login first and then a registration is that my application can’‘t/doesn’‘t know whether the user exists or not. The password is generated through a SHA1 hash and is used everytime. Basically this simulates an auto sign-on and the users don’'t need to type in a password. So basically the process should be as follows:

  1. login with user’'s username and generated password

2a. if log in succeeds then proceed as normal

2b. else run the registration for this account.

I also did try taking out the @xmpptest.partners.org and that didn’'t do the job.

Thanks,

Chris

Message was edited by:

callen

Hi Gato,

Hey Chris,

Could you check the error log file? I guess that some

exception has occurred so no answer was sent back to

the client.

This is the output from the log:

2005.03.30 18:53:19 [org.jivesoftware.messenger.net.SocketReadThread.run(SocketReadThread.java:165)

] Connection closed before session established

Socket[addr=/132.183.234.38,port=6832,localport=5222]

It doesn’'t mean much to me, but perhaps this may tell you guys something.

Also, try using the latest nightly build

which includes some minor fixes to the registration

and authentication process.

I will try this. Although I was able to get a registration to work successfully with Exodus.

This is the XMPP exchange that I did with Exodus:

SENT: <stream:stream to=“xmpptest.partners.org” xmlns=“jabber:client” xmlns:stream=“http://etherx.jabber.org/streams” xml:lang=“en” version=“1.0” >

RECV: <?xml version=''1.0'' encoding=''UTF-8''?><stream:stream xmlns:stream=“http://etherx.jabber.org/streams” xmlns=“jabber:client” from=“xmpptest.partners.org” id=“7cadf8c0” xml:lang=“en”>

SENT: test2test< /query>

RECV:

SENT: test2

RECV: test2<resource/ >

SENT: test2Exoduscc949617959ab7f109f0ebe6b0d0739a07dff0bb

Hi Guys,

I tried installing and running last nights build as Gato suggested and I still have the same problem. Do you see anything that could be wrong with the registration request?

csa65bd98ab862059feae 2cc6093fa884d4ce943903e

Any other ideas on how to get this to work would be most helpful. I would really like to use the Jive Messenger Server and this seems to be the only thing preventing me from doing so.

Thanks.

okay,

So it looks like it is not a problem with registration afterall. I ended up adding this user via the admin tool and tried again. I get the same results:

csa6

-Event : error-

-Error Code: 500-

-Error Condition: undefined-condition-

-Error Message: Unknown Error-

-Error Type: modify-

Any idea why sending it a login request like this would cause the server to throw this error and apperently quit responding to other requests?

Thanks.

Okay,

For the records this was an issue with the stream type not being set correctly. I was using “terminatedFlash” instead of “flash”. Apperently Jive Messenger does reply to the sent terminnated flash:stream/ node, but then quits responding to all other requests.

Now that I have changed this part of the XMPPConnection instatiation all is going well in regards to this stuff.

-Chris

Hi Chris - I guess persistence pays off! Thanks for the information - I had no idea as I hadn’‘t tried terminatedFlash myself, knowing that Jive Messenger was built to accomodate Flash’‘s oddities … I hadn’'t even thought about it.