Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xmppframework (iOS) and configuring authentication types

Is there a way to configure the xmppframework on iOS for a specific authentication mechanisms?

I'm having trouble connecting to an OpenFire server with the sample iPhoneXMPP app from http://code.google.com/p/xmppframework and I know that my jid, password and hostname/port are all correct but after connecting, I get a callback at:

- (void)xmppStream:(XMPPStream *)sender didNotAuthenticate:(NSXMLElement *)error

with the corresponding error:

RECV: <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/></failure>

After the initial handshake, I receive the delegate callback to

- (void)xmppStreamDidConnect:(XMPPStream *)sender
{
       if (![[self xmppStream] authenticateWithPassword:password error:&error])
            DDLogError(@"Error authenticating: %@", error);
}

XMPStream class's authenticateWithPassword method:

- (BOOL)authenticateWithPassword:(NSString *)password error:(NSError **)errPtr
{
...
// Reaches here and we get back a 'YES' because the server reports that one of the 
// supported mechanisms by 'stream:features' is DIGEST-MD5 

if ([self supportsDigestMD5Authentication])
{
   // send the digest data along with with password
}
...

I'm kind of new to this so I maybe asking the wrong question. Please point in the right direction.

like image 832
Peter Kovich Avatar asked Jun 30 '11 00:06

Peter Kovich


1 Answers

Identified that I put the username wrong in the iPhone client. I used the OpenFire server (at the local DNS namespace mba.fritz.box) to set up a user called 'germanuser' and tried to login with my username, which didn't work as described. When I tried to login with my email adress, I saw that the part after the @ sign was considered. Therefore I tried logging in with [email protected] and my password, and this worked flawlessly.

Hope this helps someone :-)

like image 181
Akku Avatar answered Nov 14 '22 22:11

Akku