有没有办法在 iOS 上为特定的身份验证机制配置 xmppframework?
我在使用来自http://code.google.com/p/xmppframework的示例 iPhoneXMPP 应用程序连接到 OpenFire 服务器时遇到问题,我知道我的 jid、密码和主机名/端口都是正确的,但连接后,我得到了回调:
- (void)xmppStream:(XMPPStream *)sender didNotAuthenticate:(NSXMLElement *)error
有相应的错误:
RECV: <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/></failure>
初次握手后,我收到委托回调
- (void)xmppStreamDidConnect:(XMPPStream *)sender
{
if (![[self xmppStream] authenticateWithPassword:password error:&error])
DDLogError(@"Error authenticating: %@", error);
}
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
}
...
我对此有点陌生,所以我可能问错了问题。请指出正确的方向。