成功连接到服务器后,即.成功回拨后
- (void) xmppStreamDidConnect:(XMPPStream *)sender
我有时会遇到身份验证失败,即.调用以下回调:
该NSXMLElement如下所示:
<failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/><text>The response provided by the client doesn't match the one we calculated.</text></failure>
就像我说的,我偶尔会得到这个.我已经追踪过这个问题,到目前为止我已经尝试了几件事.我已经研究过的事情,到目前为止我可以确认:
XMPPSCRAMSHA1Authentication)XMPPPlainAuthentication)[xmppStream disconnect])然后在xmppStreamDidDisconnect回调中尝试重新打开流([xmppStream connectWithTimeout:XMPPStreamTimeoutNone error:&error])然后我进入无限循环,因为身份验证失败一致现在,我进一步研究了这一点,当使用SCRAM-SHA-1机制时,看起来它在第二次挑战时失败了.客户端向服务器发送一些(看似有效)但服务器不喜欢它并抛出not-authorized错误.
想什么?