有没有办法在iOS上配置xmppframework以获得特定的认证机制?xmppframework(iOS)并配置认证类型
我在连接到与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
}
...
我有点新本,所以我也许问错了问题。请指出正确的方向。