XMPP客户端如何选择认证机制?
我正在尝试通过用低级Python编码来学习XMPP规范(RFC 3920) 。但我在 6.5、选择认证机制。我正在发送:
,并获取:
而不是 Base64 编码的质询。
“错误编码”错误应该是在我错误地对某些内容进行 Base64 编码,但没有要编码的文本时使用的。我可能错过了一些非常明显的东西。有人有线索吗?
我正在使用 talk.google.com 端口 5222 作为服务器,如果这很重要的话。我怀疑确实如此;这几乎肯定是由于我对 RFC 的这一部分缺乏理解。除了我发送此特定节的方式之外,问题不太可能是我的代码,否则前面的步骤将会失败。但就其价值而言,这是我迄今为止得到的代码,以及完整日志(会议记录)。谢谢。
I'm trying to learn the XMPP spec (RFC 3920) by coding it in low-level Python. But I've been hung up for over an hour at step 4 of section 6.5, selecting an authentication mechanism. I'm sending: <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'/>
, and getting: <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><incorrect-encoding/></failure>
instead of a base64-encoded challenge.
The "incorrect-encoding" error is supposedly to be used for when I incorrectly base64-encode something, but there was no text to encode. I'm probably missing something really obvious. Anybody got a cluestick?
I'm using talk.google.com port 5222 as the server, if that matters. I doubt that it does; this is almost definitely due to my lack of understanding this section of the RFC. And the problem isn't likely my code, other than the way I'm sending this particular stanza, or it would be failing at the previous steps. But for what it's worth, here is the code I've got so far, and the complete log (transcript of the session). Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,RFC 6120 通常比 3920 更清晰。[更新为指向RFC 已发布]
由于您使用的是 SASL PLAIN(请参阅 RFC 4616),许多服务器期望您在
auth
元素中发送 SASL“初始响应”,其中包含:那么,您的
auth
元素需要如下所示:对于用户名“juliet”和密码“r0m30myr0m30”。
First off, RFC 6120 is often more clear than 3920. [updated to point to the RFC as released]
Since you're using SASL PLAIN (see RFC 4616), many servers expect you to send a SASL "initial response" in the
auth
element, consisting of:All together, then, your
auth
element needs to look like this:For the username "juliet" and the password "r0m30myr0m30".