XIFF (rev 11149) auth problem on anonymous user. plz help

Guys, i have quite weird thing happen to me here, today i downloaded from XIFF svn revision 11149 for the project i dropped at some point few month ago and wanted to continue what i was doing, so when i loaded new revision it happen that i needed to fix tons of things because syntax was changed, XIFF3 is not XIFF2 after all, so i updated my code to make this thing run, but, now i have another big ass problem that i kind of can’t solve.

so scenario is pretty simple, my app connect to OpenFire as Anonymous and keeps it this way until i hit login button so it will re-login with credentials i entered. On XIFF2 it was working totally fine, i never had any issues, now on XIFF3 it gets logged in as Anonymous but after about a minute it drops the connection and fires 401 auth error, anyone can tell me why?

I will copy/past last log in case if anyone want’s to look at it.

OUTGOING: {0} <?xml version="1.0"?><stream:stream xmlns=“jabber:client” xmlns:stream=“http://etherx.jabber.org/streams” to=“grafeio.eu” version=“1.0”>

INCOMING: {0} <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream=“http://etherx.jabber.org/streams” xmlns=“jabber:client” from=“grafeio.eu” id=“14193f2e” xml:lang=“en” version=“1.0”>

handleNodeType: {0} <stream:stream xmlns:stream=“http://etherx.jabber.org/streams” xmlns=“jabber:client” id=“14193f2e” from=“grafeio.eu” xml:lang=“en” version=“1.0” />

INCOMING: {0} stream:featuresDIGEST-MD5PLAINANONYMOUSCRAM-MD5</mech anism>zlib</stream:features>

OUTGOING: {0}

sendXML. someData type: object

INCOMING: {0}

OUTGOING: {0} <?xml version="1.0"?><stream:stream xmlns=“jabber:client” xmlns:stream=“http://etherx.jabber.org/streams” to=“grafeio.eu” version=“1.0”>

INCOMING: {0} <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream=“http://etherx.jabber.org/streams” xmlns=“jabber:client” from=“grafeio.eu” id=“14193f2e” xml:lang=“en” version=“1.0”>stream:featureszlib</stream:features>

OUTGOING: {0} Grafeio</i q>

INCOMING: {0} 14193f2e@grafeio.eu/14193f2e

handleNodeType: {0} 14193f2e@grafeio.eu/14193f2e

handleBindResponse: {0} 14193f2e@grafeio.eu/14193f2e

OUTGOING: {0}

sendXML. someData type: object

INCOMING: {0}

handleNodeType: {0}

handleSessionResponse: {0}

OUTGOING: {0} 0

OUTGOING: {0}

OUTGOING: {0} Online5

INCOMING: {0} 0

INCOMING: {0} This room is not anonymous.

MESSAGE: {0} [object Message]

INCOMING: {0}

OUTGOING: {0} < />

INCOMING: {0} </stream:stream>

>>> DISCONNECTED

Might be related to the keep alive call which now sends < /> instead of a white space like in earlier version of XIFF3.

Try changing it in XMPPConnection and let us know if the problem was solved.

Let me post you here some code snippets, so you will get the idea how i do it, i figured out it’s something about keep-alive send, since it drops after i send it, but still don’t getting why it does things this way:

That’s my constructor:

public function XmppSession(loginJID:String = null, loginPwd:String = null, loginServer:String = null, anonymous:Boolean = false)

{

  SearchExtension.enable();

  MUC.enable();

  _conn = new XMPPConnection();

 _conn.resource = "Grafeio";

 _conn.useAnonymousLogin = anonymous;

       

 _inviteListener = new InviteListener();

 _inviteListener.setConnection(_conn);

  this.loginJID = loginJID;

  this.loginPwd = loginPwd;

  this.loginServer = loginServer;

  initObjects();

 setupConnectionListeners();

 setupRosterListeners();

 setupPresenceListeners();

 setupMessageListeners();

 _doRegister = false;

       

 keepAlive = new Timer(15000);

 keepAlive.addEventListener(TimerEvent.TIMER, onKeepAliveLoop);

}

On Keep Alive timer i do this:

private function onKeepAliveLoop(evt:TimerEvent):void

{

 if(new Date().getTime() - _lastSent > 15000)

      _conn.sendKeepAlive();

}

I attached whole class just to make sure i didn’t missed anything…
XmppSession.as.zip (3760 Bytes)

Try current trunk version.

I assume disconnect was due “OUTGOING: {0} < />”,

but the auth, even when anonymous, requires a username.

This might be another bug in XMPPConnection, to require the username, but need take a moment to read the corresponding RFC.

let me try, will hit with result in few moments.

it seems last build worked for me, i see it does keep alive and not falling. Thanks for the help, i really appreciate it.