带 openfire 的 XMPPframewok
我已经设置了自己的 Openfire 服务器并使用 Spark 和 Adium 对其进行了测试。尽管在从 XMPPFramework for iOS 运行示例项目时出现以下身份验证错误:
2011-11-16 01:34:26:850 iPhoneXMPP[1245:207] iPhoneXMPPAppDelegate: xmppStream:socketDidConnect:
2011-11-16 01:34:26:850 iPhoneXMPP[1245:8d0f] SEND: <stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' to='flashmatch.net'>
2011-11-16 01:34:27:464 iPhoneXMPP[1245:7b13] RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="ip-10-112-57-167" id="ff9c2cf2" xml:lang="en" version="1.0"/>
2011-11-16 01:34:27:772 iPhoneXMPP[1245:8d0f] RECV: <stream:features><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"> <mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>CRAM-MD5</mechanism></mechanisms><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><auth xmlns="http://jabber.org/features/iq-auth"/><register xmlns="http://jabber.org/features/iq-register"/></stream:features>
2011-11-16 01:34:27:772 iPhoneXMPP[1245:207] iPhoneXMPPAppDelegate: xmppStreamDidConnect:
2011-11-16 01:34:27:772 iPhoneXMPP[1245:207] SEND: <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='DIGEST-MD5'/>
2011-11-16 01:34:28:079 iPhoneXMPP[1245:7b13] RECV: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cmVhbG09ImlwLTEwLTExMi01Ny0xNjciLG5vbmNlPSIycWZoY01JL0R2a0Z0ME41TmNSdGpUaGk0dmVOamk4YUxHMU9LMmZwIixxb3A9ImF1dGgiLGNoYXJzZXQ9dXRmLTgsYWxnb3JpdGhtPW1kNS1zZXNz</challenge>
2011-11-16 01:34:28:079 iPhoneXMPP[1245:7b13] decoded response: username="alan",realm="ip- 10-112-57-167",nonce="2qfhcMI/DvkFt0N5NcRtjThi4veNji8aLG1OK2fp",cnonce="8C2C32EC-532A-4A75-8166-F75387CE2F84",nc=00000001,qop=auth,digest-uri="xmpp/flashmatch.net",response=8b1ad8c7c968a92d36ff6ed895b0ed80,charset=utf-8
2011-11-16 01:34:28:080 iPhoneXMPP[1245:7b13] SEND: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dXNlcm5hbWU9ImFsYW4iLHJlYWxtPSJpcC0xMC0xMTItNTctMTY3Iixub25jZT0iMnFmaGNNSS9EdmtGdDBONU5jUnRqVGhpNHZlTmppOGFMRzFPSzJmcCIsY25vbmNlPSI4QzJDMzJFQy01MzJBLTRBNzUtODE2Ni1GNzUzODdDRTJGODQiLG5jPTAwMDAwMDAxLHFvcD1hdXRoLGRpZ2VzdC11cmk9InhtcHAvZmxhc2htYXRjaC5uZXQiLHJlc3BvbnNlPThiMWFkOGM3Yzk2OGE5MmQzNmZmNmVkODk1YjBlZDgwLGNoYXJzZXQ9dXRmLTg=</response>
2011-11-16 01:34:28:386 iPhoneXMPP[1245:8d0f] RECV: <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/></failure>
2011-11-16 01:34:28:386 iPhoneXMPP[1245:207] iPhoneXMPPAppDelegate: xmppStream:didNotAuthenticate:
但是,在连接到 talk.google.com 时,相同的示例项目运行良好。有人知道这里出了什么问题吗?
I've setup my own Openfire server and have it tested with Spark and Adium. Though I got the following authentication error when running the sample project from XMPPFramework for iOS:
2011-11-16 01:34:26:850 iPhoneXMPP[1245:207] iPhoneXMPPAppDelegate: xmppStream:socketDidConnect:
2011-11-16 01:34:26:850 iPhoneXMPP[1245:8d0f] SEND: <stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' to='flashmatch.net'>
2011-11-16 01:34:27:464 iPhoneXMPP[1245:7b13] RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="ip-10-112-57-167" id="ff9c2cf2" xml:lang="en" version="1.0"/>
2011-11-16 01:34:27:772 iPhoneXMPP[1245:8d0f] RECV: <stream:features><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"> <mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>CRAM-MD5</mechanism></mechanisms><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><auth xmlns="http://jabber.org/features/iq-auth"/><register xmlns="http://jabber.org/features/iq-register"/></stream:features>
2011-11-16 01:34:27:772 iPhoneXMPP[1245:207] iPhoneXMPPAppDelegate: xmppStreamDidConnect:
2011-11-16 01:34:27:772 iPhoneXMPP[1245:207] SEND: <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='DIGEST-MD5'/>
2011-11-16 01:34:28:079 iPhoneXMPP[1245:7b13] RECV: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cmVhbG09ImlwLTEwLTExMi01Ny0xNjciLG5vbmNlPSIycWZoY01JL0R2a0Z0ME41TmNSdGpUaGk0dmVOamk4YUxHMU9LMmZwIixxb3A9ImF1dGgiLGNoYXJzZXQ9dXRmLTgsYWxnb3JpdGhtPW1kNS1zZXNz</challenge>
2011-11-16 01:34:28:079 iPhoneXMPP[1245:7b13] decoded response: username="alan",realm="ip- 10-112-57-167",nonce="2qfhcMI/DvkFt0N5NcRtjThi4veNji8aLG1OK2fp",cnonce="8C2C32EC-532A-4A75-8166-F75387CE2F84",nc=00000001,qop=auth,digest-uri="xmpp/flashmatch.net",response=8b1ad8c7c968a92d36ff6ed895b0ed80,charset=utf-8
2011-11-16 01:34:28:080 iPhoneXMPP[1245:7b13] SEND: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dXNlcm5hbWU9ImFsYW4iLHJlYWxtPSJpcC0xMC0xMTItNTctMTY3Iixub25jZT0iMnFmaGNNSS9EdmtGdDBONU5jUnRqVGhpNHZlTmppOGFMRzFPSzJmcCIsY25vbmNlPSI4QzJDMzJFQy01MzJBLTRBNzUtODE2Ni1GNzUzODdDRTJGODQiLG5jPTAwMDAwMDAxLHFvcD1hdXRoLGRpZ2VzdC11cmk9InhtcHAvZmxhc2htYXRjaC5uZXQiLHJlc3BvbnNlPThiMWFkOGM3Yzk2OGE5MmQzNmZmNmVkODk1YjBlZDgwLGNoYXJzZXQ9dXRmLTg=</response>
2011-11-16 01:34:28:386 iPhoneXMPP[1245:8d0f] RECV: <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/></failure>
2011-11-16 01:34:28:386 iPhoneXMPP[1245:207] iPhoneXMPPAppDelegate: xmppStream:didNotAuthenticate:
The same sample project works well when connecting to talk.google.com however. Any one knows what went wrong here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果不查看代码,很难猜出问题所在,但身份验证问题表明您的用户 JID 或密码存在问题。所以我可以想到两个可能的问题:
It is hard to guess the problem without looking that the code but the authontication problem indicates a problem in your users JIDs or passwords. So i can think of two possible problems:
当您尝试登录时,请提供用户名和服务器的 IP 地址,例如“[email protected] ]”
如果你是尝试登录指定的域,然后在 setupStream 方法中添加这些代码行
When you try to login, provide user name with the ip address of server like "[email protected]"
If you are trying to login at a specified domain then add these line of code in setupStream Method
您可以在管理面板中查看 openfire ServerName。
主机地址/IP 可能与服务器名称中的不同:
如果服务器名称与主机地址设置不同,则如下所示。在大多数情况下,服务器名称和名称主机地址相同。所以 iOS xmppframework 的身份验证没有问题。
You could check the openfire ServerName in admin panel.
Host Address / IP might be different from the one in Server Name:
if server name is different than host address settings would be like below. In most situations server name & host address are same. so no issues in authentication with iOS xmppframework.