0

我正在使用 Openfire 和 xmpp4r 在教程的帮助下连接到服务器。本教程适用于除我之外的所有人,它在线抛出错误

@client.auth(@password)

错误是

Jabber::ClientAuthenticationFailure: not-authorized
from /home/haider/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/xmpp4r-0.5.6/lib/xmpp4r/client.rb:120:in `rescue in auth'
from /home/haider/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/xmpp4r-0.5.6/lib/xmpp4r/client.rb:109:in `auth'
from (irb):32
from /home/haider/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/commands/console.rb:110:in `start'
from /home/haider/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/commands/console.rb:9:in `start'
from /home/haider/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:68:in `console'
from /home/haider/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!

我在 Google 上找到了一个解决方案,可以解决在 JID 中附加资源名称的类似问题,但这也不适用于 Openfire

任何帮助将不胜感激。谢谢

4

1 回答 1

0

在这里查看我的答案:

https://github.com/xmpp4r/xmpp4r/issues/42

基本上,调用它而不是 vanilla auth 方法:

client.auth_sasl SASL.new(client, 'PLAIN'), password

至于为什么 SASL + 摘要不能与新的 Openfire 一起使用,我不确定。

于 2016-01-19T18:18:20.277 回答