sansid1983
sansid1983

Reputation: 239

Connecting to Openfire server using XMPP in iOS

I have installed openfire into my mac. In opnefire server information my Server Name is "john-imac.local.lan" and Host Name is "john-imac.local.lan"

I have created two users user123,user234 in there. In my iphone project i have xmpp framework running fine when i use gmail credentials. To connect to openfire i made these changes

[xmppStream setHostName:@"john-imac.local.lan"];

xmppStream.myJID = [XMPPJID jidWithString:@"[email protected]"];

(void)xmppStreamDidConnect:(XMPPStream *)sender
{
    NSLog(@"XMPP DID CONNECT");
    [xmppStream authenticateWithPassword:@"user001" error:NULL];

}

I guess these are changes that i need to make in my project to get connected to Openfire. But when i run the application i get this XMPP DID NOT AUTHENTICATE

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

What is that i am missing.

Upvotes: 2

Views: 8407

Answers (2)

zhijie
zhijie

Reputation: 642

  1. go to Server -》Server Manager -》 System Properties

  2. In the page bottom, there is a form, in “Property name” put “xmpp.fqdn” and in “Property value” put your domain name

  3. Restart openfire

Upvotes: 0

Bashar Altakrouri
Bashar Altakrouri

Reputation: 10595

I do not think it is a problem in the code. I think it is just a miss configuration in your Openfire sever. First make sure your users and passwords were created correctly in your Openfire. Second check the "Server Name" property if it was set correctly. Go to you admin panel -> Server Information -> Server Name. If this property is not set to "john-imac.local.lan" then your server will fail in authorizing your users. To set it up pressed on the Edit properties button and change the name of your sever.

I hope this helps you solving the problem you are having!

Upvotes: 2

Related Questions