我使用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!
我谷歌并找到了一个解决类似问题的解决方案,附加资源名称与JID,但这也不适合Openfire
任何帮助都将非常感激。由于
请看我的回答:
https://github.com/xmpp4r/xmpp4r/issues/42 基本上,调用这个方法而不是普通的auth方法: client.auth_sasl SASL.new(client, 'PLAIN'), password
至于为什么SASL + digest不能与新版本的Openfire一起工作,我不确定。