Xmppframework (iOS) and setting authentication types

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

I am having problems connecting to the OpenFire server with the iPhoneXMPP sample application 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 callback to:

- (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 get a delegate callback to

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

XMPStreamWithPassword class authentication 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 might be asking the wrong question. Please point in the right direction.

+6
source share
2 answers

It is determined that I entered the username incorrectly on the iPhone. I used the OpenFire server (in the local DNS space mba.fritz.box) to configure a user called "germanuser" and tried to log in with my username, which does not work as described. When I tried to log in with my email address, I saw that the part after the @ sign was considered. So I tried to log in with germanuser@mba.fritz.box and my password, and it worked flawlessly.

Hope this helps someone :-)

+2
source

It is obvious from your description that your account or password is incorrect. Make sure the account is complete, for example, name@example.com

0
source

Source: https://habr.com/ru/post/891689/


All Articles