我使用Openfire和xmpp4r在tutorial的帮助下连接到服务器。本教程适用于除了我之外的所有人,它在线投掷错误
@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!
我谷歌并找到solution解决类似的问题,用JID附加资源名称,但这也不适用于Openfire
任何帮助都将受到高度赞赏。感谢
答案 0 :(得分:0)
请在此处查看我的回答:
https://github.com/xmpp4r/xmpp4r/issues/42
基本上,请调用此代替vanilla auth方法:
client.auth_sasl SASL.new(client, 'PLAIN'), password
至于为什么SASL + digest不适用于新的Openfire,我不确定。