Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Jabber::ClientAuthenticationFailure: not-authorized using xmpp4r and openfire #42

Open
wonderer007 opened this issue Jul 22, 2015 · 5 comments

Comments

@wonderer007
Copy link

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:inauth'
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:instart'
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:inrun_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

@coderhs
Copy link
Member

coderhs commented Jul 22, 2015

Which tutorial are you referring to?

@wonderer007
Copy link
Author

@seanleblanc
Copy link

I am having the same problem. Here is debug output:

D, [2016-01-06T11:34:07.952396 #3808] DEBUG -- : RESOLVING:
_xmpp-client._tcp.icdt-jabr.icdt.net (SRV)
D, [2016-01-06T11:34:07.955365 #3808] DEBUG -- : CONNECTING:
icdt-jabr.icdt.net:5222
D, [2016-01-06T11:34:07.957715 #3808] DEBUG -- : SENDING:
<stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' to='icdt-jabr.icdt.net' xml:lang='en' version='1.0' >
D, [2016-01-06T11:34:07.961555 #3808] DEBUG -- : RECEIVED:
<stream:stream from='icdt.net' id='a0facb7f' xml:lang='en' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xmlns='jabber:client'/>
D, [2016-01-06T11:34:07.961858 #3808] DEBUG -- : FEATURES: waiting...
D, [2016-01-06T11:34:07.963308 #3808] DEBUG -- : RECEIVED:
stream:featuresDIGEST-MD5PLAINCRAM-MD5zlib/stream:features
D, [2016-01-06T11:34:07.963646 #3808] DEBUG -- : FEATURES: received
D, [2016-01-06T11:34:07.964036 #3808] DEBUG -- : PROCESSING:
<stream:features xmlns='jabber:client'>DIGEST-MD5PLAINCRAM-MD5zlib/stream:features (REXML::Element)
D, [2016-01-06T11:34:07.964091 #3808] DEBUG -- : FEATURES: waiting finished
D, [2016-01-06T11:34:07.964176 #3808] DEBUG -- : TRYING stanzacbs...
D, [2016-01-06T11:34:07.964450 #3808] DEBUG -- : SENDING:

D, [2016-01-06T11:34:07.964563 #3808] DEBUG -- : TRYING message/iq/presence/cbs...
D, [2016-01-06T11:34:07.966742 #3808] DEBUG -- : RECEIVED:
cmVhbG09ImljZHQubmV0Iixub25jZT0icGFQWWd1TmsrK2UySXVVVnlIZzJMek16Z2NyTXdhSFNpdkNMU1E4eSIscW9wPSJhdXRoIixjaGFyc2V0PXV0Zi04LGFsZ29yaXRobT1tZDUtc2Vzcw==
D, [2016-01-06T11:34:07.967125 #3808] DEBUG -- : SASL DIGEST-MD5 challenge:
realm="icdt.net",nonce="paPYguNk++e2IuUVyHg2LzMzgcrMwaHSivCLSQ8y",qop="auth",charset=utf-8,algorithm=md5-sess
{"realm"=>"icdt.net", "nonce"=>"paPYguNk++e2IuUVyHg2LzMzgcrMwaHSivCLSQ8y", "qop"=>"auth", "charset"=>"utf-8", "algorithm"=>"md5-sess"}
D, [2016-01-06T11:34:07.967383 #3808] DEBUG -- : SASL DIGEST-MD5 response:
nonce="paPYguNk++e2IuUVyHg2LzMzgcrMwaHSivCLSQ8y",charset=utf-8,username="gitbot",realm="icdt.net",cnonce="5d809d325010a61814f1936caaec31cc",nc=00000001,qop=auth,digest-uri="xmpp/icdt-jabr.icdt.net",response=0ac87fc11088396ace73ef3a6eafa8f2
{"nonce"=>""paPYguNk++e2IuUVyHg2LzMzgcrMwaHSivCLSQ8y"", "charset"=>"utf-8", "username"=>""gitbot"", "realm"=>""icdt.net"", "cnonce"=>""5d809d325010a61814f1936caaec31cc"", "nc"=>"00000001", "qop"=>"auth", "digest-uri"=>""xmpp/icdt-jabr.icdt.net"", "response"=>"0ac87fc11088396ace73ef3a6eafa8f2"}
D, [2016-01-06T11:34:07.967588 #3808] DEBUG -- : SENDING:
bm9uY2U9InBhUFlndU5rKytlMkl1VVZ5SGcyTHpNemdjck13YUhTaXZDTFNROHkiLGNoYXJzZXQ9dXRmLTgsdXNlcm5hbWU9ImdpdGJvdCIscmVhbG09ImljZHQubmV0Iixjbm9uY2U9IjVkODA5ZDMyNTAxMGE2MTgxNGYxOTM2Y2FhZWMzMWNjIixuYz0wMDAwMDAwMSxxb3A9YXV0aCxkaWdlc3QtdXJpPSJ4bXBwL2ljZHQtamFici5pY2R0Lm5ldCIscmVzcG9uc2U9MGFjODdmYzExMDg4Mzk2YWNlNzNlZjNhNmVhZmE4ZjI=
D, [2016-01-06T11:34:07.970070 #3808] DEBUG -- : RECEIVED:

D, [2016-01-06T11:34:07.970469 #3808] DEBUG -- : RuntimeError: not-authorized
/var/lib/gems/1.9.1/gems/xmpp4r-0.5.6/lib/xmpp4r/sasl.rb:206:in auth' /var/lib/gems/1.9.1/gems/xmpp4r-0.5.6/lib/xmpp4r/client.rb:176:inauth_sasl'
/var/lib/gems/1.9.1/gems/xmpp4r-0.5.6/lib/xmpp4r/client.rb:111:in `auth'

@seanleblanc
Copy link

wonderer007, what version of Openfire are you using? We are using 3.10.3. We used to use Openfire 3.6.4, and after upgrade to 3.10.3, the gem started failing to connect.

@seanleblanc
Copy link

In case this helps anyone else, doing this worked:

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

Otherwise, the plain old client.auth method tries to do message digest if the server offers it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants