首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >XMPP SASL认证

XMPP SASL认证
EN

Stack Overflow用户
提问于 2014-09-07 15:44:11
回答 1查看 4.5K关注 0票数 0

我正试图为我将要开发的基于XMPP的应用程序创建一个XMPP服务器库。我被困在试图用普通的SASL认证客户端上。我已经在https://www.rfc-editor.org/rfc/rfc6120#section-6.4.6读过RFC了。

我的问题是,在发送、接收和发送一个新的打开标记和一个空的特性列表之后,客户机(Pidgin)继续使用非SASL身份验证。这是通信的日志(<<表示传入,>>传出):

代码语言:javascript
复制
<<  <?xml version='1.0' ?><stream:stream to='127.0.0.1' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>

>>  <?xml version="1.0" ?>
>>  <stream:stream version="1.0" xmlns="jabber:server" xmlns:stream="http://etherx.jabber.org/streams" id="kanapka" from="127.0.0.1">
>>  <stream:features>
>>  <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
>>  <mechanism>
>>  PLAIN
>>  </mechanism>
>>  </mechanisms>
>>  </stream:features>

<<  <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN' xmlns:ga='http://www.google.com/talk/protocol/auth' ga:client-uses-full-bind-result='true'>AHRlc3R1c2VyAHRlc3RwYXNz</auth>

>>  <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl" />

<<  <stream:stream to='127.0.0.1' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>

>>  <?xml version="1.0" ?>
>>  <stream:stream version="1.0" xmlns="jabber:server" xmlns:stream="http://etherx.jabber.org/streams" id="hotdog" from="127.0.0.1">
>>  <stream:features />

<<  <iq type='get' id='purple46cbc043'><query xmlns='jabber:iq:auth'><username>testuser</username></query></iq>

我还没有使用TLS,也没有尝试过任何其他SASL机制。这都是纯文本。

这是相同的TCP连接,流的is是不同的。这里有什么问题?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-09-07 16:18:29

您没有宣传对资源绑定的支持,因此客户端无法完成会话设置。如果服务器不支持XMPP风格的流设置,那么Pidgin似乎决定回到jabber:iq:auth (前XMPP风格)。

您需要了解https://www.rfc-editor.org/rfc/rfc6120#section-7,因为“在XMPP客户端和服务器实现中需要对资源绑定的支持”。“流的各方必须将资源约束视为必须协商的义务”。

虽然通过查看其他实现来实现XMPP,而不是遵循规范,这并不是一个好主意,有时浏览另一个实现的流会给出这样的提示。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25712026

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档