xmppframework(iOS)和配置身份验证类型

Pet*_*ich 6 iphone cocoa-touch objective-c xmppframework

有没有办法在iOS上为特定的身份验证机制配置xmppframework?

我无法使用http://code.google.com/p/xmppframework上的示例iPhoneXMPP应用程序连接到OpenFire服务器,我知道我的jid,密码和主机名/端口都正确但连接后,我得到了回调:

- (void)xmppStream:(XMPPStream *)sender didNotAuthenticate:(NSXMLElement *)error
Run Code Online (Sandbox Code Playgroud)

带有相应的错误:

RECV: <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/></failure>
Run Code Online (Sandbox Code Playgroud)

在初始握手之后,我收到了委托回调

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

XMPStream类的authenticateWithPassword方法:

- (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
}
...
Run Code Online (Sandbox Code Playgroud)

我对此有点新意,所以我可能会问错误的问题.请指出正确的方向.

Akk*_*kku 2

发现我在 iPhone 客户端输入的用户名错误。我使用 OpenFire 服务器(位于本地 DNS 命名空间 mba.fritz.box)设置一个名为“germanuser”的用户,并尝试使用我的用户名登录,但该用户名与描述的不符。当我尝试使用我的电子邮件地址登录时,我看到 @ 符号后面的部分已被考虑。因此,我尝试使用 germanuser@mba.fritz.box 和我的密码登录,效果完美。

希望这对某人有帮助:-)