Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
Architecta #1
Member since Jun 2007 · 4 posts · Location: Mauritius
Group memberships: Members
Show profile · Link to this post
Subject: MiniClient registration issue
Hi,

I installed the latest jabberd2 2.1.11 and downloaded the latest SVN source of agsXMPP but i'm having registration problems.

I'm running on WinXP PRO SP2 and .NET 3.0.

Exodus client works successfully with the jabberd2 server. (both registration and login)

I compiled the latest SVN developer source of the SDK. (Everthing is OK)
I compiled the MiniClient 2005 included in the version 0.92 package against the latest SVN source. (modifications adjusted accordingly; Everything works fine)

When I try to register a new account on the server, i got the following output and it just hangs there:

SEND: <stream:stream to='shodan' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>

RECV: <?xml version='1.0'?><stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' from='shodan' version='1.0' id='a4d9hhwq7m2utpdwlbsqygvv8jzz2235h5sedcbl'>

RECV: <stream:features xmlns:stream='http://etherx.jabber.org/streams'><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>ANONYMOUS</mechanism></mechanisms></stream:features>

But I found a small trick to force registration:

In the file XmppClientConnection.cs:

...
public override void StreamParserOnStreamStart(object sender, Node e)
{
    ...
    // Auth stuff
    if (!RegisterAccount)
    {
         if (this.StreamVersion != null && this.StreamVersion.StartsWith("1."))
         {
             if (!Authenticated)
             {
                // we assume server supports SASL here, because it advertised a StreamVersion 1.X
                // and wait for the stream features and initialize the SASL Handler

                InitSaslHandler();                       
             }               
          }
          else
          {
        // old auth stuff           
                RequestLoginInfo();
       }
    }
    else
    {       
          // Register on "old" jabber servers without stream features
          [b]if (this.StreamVersion == null) <<-------------------- Comment this line[/b]
          {
                    GetRegistrationFields(null);
          }
}


In the above code, if i comment the line "if (this.StreamVersion == null)", the MiniClient works successfully (both registration and login).

The output XML when I commented this line is:

AFTER REGISTRATION:
SEND: <stream:stream to='shodan' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>

RECV: <?xml version='1.0'?><stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' from='shodan' version='1.0' id='wd40by65y2fydchiur08c705j25qjltcr5mfev7f'>

SEND: <iq xmlns="jabber:client" id="agsXMPP_1" type="get" to="shodan"><query xmlns="jabber:iq:register" /></iq>

RECV: <stream:features xmlns:stream='http://etherx.jabber.org/streams'><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>ANONYMOUS</mechanism></mechanisms></stream:features>

RECV: <iq xmlns='jabber:client' id='agsXMPP_1' type='result'><query xmlns='jabber:iq:register'><username/><password/><instructions>Enter a username and password to register with this server.</instructions></query></iq>

SEND: <iq xmlns="jabber:client" type="set" id="agsXMPP_2" to="shodan"><query xmlns="jabber:iq:register"><username>architecta</username><password>secret</password></query></iq>

RECV: <iq xmlns='jabber:client' id='agsXMPP_2' type='result'/>


AFTER LOGIN:
SEND: <stream:stream to='shodan' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>

RECV: <?xml version='1.0'?><stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' from='shodan' version='1.0' id='d91ept6yihmgjxt5bjtfvuwl9qdxnthq553xkdws'>

RECV: <stream:features xmlns:stream='http://etherx.jabber.org/streams'><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>ANONYMOUS</mechanism></mechanisms></stream:features>

SEND: <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="DIGEST-MD5" />

RECV: <challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>bm9uY2U9IlUxUVhaRUlJUFZWTU5pc05XRGRxZFdjaEtIZ0xlbXNFUkNRWGZIWWFGMW89IixyZWFsbT0ic2hvZGFuIixxb3A9ImF1dGgsYXV0aC1pbnQsYXV0aC1jb25mIixjaXBoZXI9InJjNC00MCxyYzQtNTYscmM0IixtYXhidWY9MTAyNCxjaGFyc2V0PXV0Zi04LGFsZ29yaXRobT1tZDUtc2Vzcw==</challenge>

SEND: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dXNlcm5hbWU9ImFyY2hpdGVjdGEiLHJlYWxtPSJzaG9kYW4iLG5vbmNlPSJVMVFYWkVJSVBWVk1OaXNOV0RkcWRXY2hLSGdMZW1zRVJDUVhmSFlhRjFvPSIsY25vbmNlPSJmNDBlNTU0NzE2ZDUxNmM5NjU4NmY2NGJkMmZlMmU5Yjg1MTA4ZjYwODE3ZWMwYjk0MjVlMjY4ZTZiZWJlNmNiIixuYz0wMDAwMDAwMSxxb3A9YXV0aCxkaWdlc3QtdXJpPSJ4bXBwL3Nob2RhbiIsY2hhcnNldD11dGYtOCxyZXNwb25zZT1kNDdhYjRjOTJiZWNiMmQwOWRkY2E4MjExOWEyMTYyNQ==</response>

RECV: <challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>cnNwYXV0aD05NGE4OTg2MGQ3M2Y0NmJhZDEwNDgxMDE1N2NlNGJmOQ==</challenge>

SEND: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl" />

RECV: <success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>

SEND: <stream:stream to='shodan' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>

RECV: <?xml version='1.0'?><stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' from='shodan' version='1.0' id='lj7wh4j72xeynhfzn3je58meoh3h8d6bloe12h8b'>

RECV: <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'/></stream:features>

SEND: <iq xmlns="jabber:client" id="agsXMPP_1" type="set" to="shodan"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><resource>MiniClient</resource></bind></iq>

RECV: <iq xmlns='jabber:client' id='agsXMPP_1' type='result'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><jid>architecta@shodan/MiniClient</jid></bind></iq>

SEND: <iq xmlns="jabber:client" id="agsXMPP_2" type="set" to="shodan"><session xmlns="urn:ietf:params:xml:ns:xmpp-session" /></iq>

RECV: <iq xmlns='jabber:client' id='agsXMPP_2' type='result'/>

SEND: <iq xmlns="jabber:client" id="agsXMPP_3" type="get" to="shodan"><query xmlns="http://jabber.org/protocol/disco#items" /></iq>

SEND: <iq xmlns="jabber:client" id="agsXMPP_4" type="get" to="shodan"><query xmlns="jabber:iq:agents" /></iq>

SEND: <iq xmlns="jabber:client" id="agsXMPP_5" type="get"><query xmlns="jabber:iq:roster" /></iq>

RECV: <iq xmlns='jabber:client' type='result' id='agsXMPP_5'><query xmlns='jabber:iq:roster'/></iq>

SEND: <presence xmlns="jabber:client"><status /><priority>1</priority></presence>

RECV: <iq xmlns='jabber:client' id='agsXMPP_3' from='shodan' to='architecta@shodan/MiniClient' type='result'><query xmlns='http://jabber.org/protocol/disco#items'><item name='Public Chatrooms' jid='conference.shodan'/></query></iq>

SEND: <iq xmlns="jabber:client" id="agsXMPP_6" type="get" to="conference.shodan"><query xmlns="http://jabber.org/protocol/disco#info" /></iq>

RECV: <iq xmlns='jabber:client' id='agsXMPP_4' from='shodan' to='architecta@shodan/MiniClient' type='result'><query xmlns='jabber:iq:agents'><agent jid='conference.shodan'><name>Public Chatrooms</name><service>text</service><register/><groupchat/></agent></query></iq>

RECV: <iq xmlns='jabber:client' id='agsXMPP_6' type='result' to='architecta@shodan/MiniClient' from='conference.shodan'><query xmlns='http://jabber.org/protocol/disco#info'><identity category='conference' type='text' name='Public Chatrooms'/><feature var='http://jabber.org/protocol/muc'/><feature var='http://jabber.org/protocol/disco'/><feature var='jabber:iq:browse'/><feature var='jabber:iq:register'/><feature var='jabber:iq:version'/><feature var='jabber:iq:time'/><feature var='jabber:iq:last'/><feature var='vcard-temp'/><feature var='urn:xmpp:ping'/></query></iq>

What do you think?
Is it because that jabberd2 does NOT advertise registration as a stream feature?

Looking at the output after registration, it seems that jabberd2 does not advertise a "Register IQ" stanza in the beginning.

Best Regards,
Fadil.
Avatar
Alex #2
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by Architecta:
What do you think?
Is it because that jabberd2 does NOT advertise registration as a stream feature?

Looking at the output after registration, it seems that jabberd2 does not advertise a "Register IQ" stanza in the beginning.

yes. look in XmppCleintConnection in:

  1. public override void StreamParserOnStreamElement(object sender, Node e)
  2. {
  3.    ...
  4.    else if (f.SupportsRegistration && m_RegisterAccount)
  5.    ...
  6. }

if a server sends stream version 1.0 it should/must advertise all features which are supported.
I'm not that familiar with jabberd2. Is there a way to configure the stream features?

Alex
Avatar
Architecta #3
Member since Jun 2007 · 4 posts · Location: Mauritius
Group memberships: Members
Show profile · Link to this post
hello again,

From the XML output, it seems that the server returns "stream version 1.0".

You said if the stream version "1.0" the server must advertise all features (including registration feature) which are supported, but I don't know why "f.SupportsRegistration" returns false.

BTW, is there a difference between <register xmlns="http://jabber.org/features/iq-register"/> and <feature var='jabber:iq:register'/> ?

I don't think there is a way to configure jabberd2 for advertising registration stream features as I don't see <register xmlns="http://jabber.org/features/iq-register"/> in the latest server source code.

I can see only <feature var='jabber:iq:register'/>.

Regards,
Fadil.
Avatar
Alex #4
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by Architecta:
I can see only <feature var='jabber:iq:register'/>.

This is from the disco features, not the stream features.

Alex
Avatar
Architecta #5
Member since Jun 2007 · 4 posts · Location: Mauritius
Group memberships: Members
Show profile · Link to this post
Alex,

I now know this is a server-side stuff. Is there any other way from the client-side to solve this issue so that "f.SupportsRegistration" returns true ?

Fadil.
Avatar
Alex #6
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
no,

you can change the code to return always true for f.SupportsRegistration. But this is a dirty hack only.

Alex
Avatar
Architecta #7
Member since Jun 2007 · 4 posts · Location: Mauritius
Group memberships: Members
Show profile · Link to this post
Thanks for your precious help and time Alex.

I think I'll wait until jabberd2 supports the complete stream features. I just posted a new ticket for that :)

BTW, have you plan to develop a full-featured open-source client using this powerful SDK (similar to the new Soapbox Communicator 2007) ?
If yes that would be great ;)

Cheers,
Fadil.
Avatar
Alex #8
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hello,

i will also ping the jabberd2 developer once i see him online. I'm sure he will fix it very fast.

Currently we don't have the resources to write/finish our clients and open source them.
There are already 2 other open source clients based on agsXMPP. Maybe you can help them out and make them better and feature complete.

Xeus-Messenger and MyJabberIM.

Alex
Avatar
Alex #9
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
there is a new jabberd2 release.

Quote by Tomasz Sterna:
Things are getting faster and there is another jabberd 2.1 series release.

Get 2.1.12 release as usual at:
http://ftp.xiaoka.com/jabberd2/releases/jabberd-2.1.12.tar…
http://ftp.xiaoka.com/jabberd2/releases/jabberd-2.1.12.tar…

and read: http://svn.xiaoka.com/jabberd2/trunk/UPGRADE


This is a big memleak-fix release. There are also few new features
mostly PostgreSQL related. Compliance fixes are there too.

ChangeLog:
Fixed many memleaks
  • Check if OpenSSL is already initialized in PostgreSQL backend
  • Implemented PQconnectdb PostgreSQL connection method
  • Applied pg_config using by configure patch
  • Implemented auth/reg stream features advertisement. Fixes #118
  • Removed useless while/alloc loops
  • WiX notes for Windows README
  • WiX new "JabberWelcomeDlg?"
  • WiX fixed cases of reinstall & upgrade
  • nad_cache_new & nad_cache_free exported as JABBERD2_API functions.
  • Changed allocator BLOCKSIZE to 128 bytes

For a full ChangeLog see:
http://svn.xiaoka.com/jabberd2/trunk/ChangeLog
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS