0
votes

I have setup an openfire server on my local machine and created few users. Now when I am trying to connect to this server from my iOS application but it is throwing below error in console

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

But when I try to connect using spark client app it is successfully connecting to the local openfire server.

I am using robbiehanson/XMPPFramework as an iOS client

and passing userid as "user1@ServerName" where ServerName is "Server Name" value shown in openfire admin console.

Is there any thing more I need to do?

1

1 Answers

0
votes

keep in mind you have to follow below way.

 user: [email protected]
    [email protected]
    at time of groups Create : write ->  conference.rakeshs-mac-mini.local

warning Set here Server Name...like below in Appdelegate.m

if([domain isEqualToString:@"rakeshs-mac-mini.local"]) {}

NSString *myJID = [[NSUserDefaults standardUserDefaults] stringForKey:kXMPPmyJID];
NSString *myPassword = [[NSUserDefaults standardUserDefaults] stringForKey:kXMPPmyPassword];

if (myJID == nil || myPassword == nil) {
    return NO;
}

warning Set Username as username@servername

myJID = [NSString stringWithFormat:@"%@@rakeshs-Mac-mini.local",myJID];

[xmppStream setMyJID:[XMPPJID jidWithString:myJID]];
password = myPassword;

NSLog(@"username: %@,Password : %@",myJID,myPassword);