0

I am using Openfire and xmpp4r to connect to server with the help of tutorial. This tutorial is working fine for everyone except me, its throwing error on line

@client.auth(@password)

Error is

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!

I Google and found a solution which resolve similar problem appending resource name with JID but this too is not working for Openfire

Any help will be highly appreciated. Thanks

Haider Ali
  • 800
  • 2
  • 9
  • 22

1 Answers1

0

See my answer here:

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

Basically, call this instead of vanilla auth method:

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

As to why SASL + digest doesn't work with new-ish Openfire, I am unsure.

Sean LeBlanc
  • 185
  • 2
  • 12