有沒有辦法在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
}
...
我有點新本,所以我也許問錯了問題。請指出正確的方向。