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 ba开发者_开发百科ck 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.
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 germanuser@mba.fritz.box and my password, and this worked flawlessly.
Hope this helps someone :-)
Obviously from your description, that your account or password is wrong. Make sure that the account is complete like name@example.com
精彩评论