Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Problems with XMPP4R with Google Apps for your Domain account

Reply
Thread Tools

Problems with XMPP4R with Google Apps for your Domain account

 
 
Mark
Guest
Posts: n/a
 
      09-03-2009
I am having problems connecting (using the xmpp4r ruby api) to an
account on a 'Google Apps for your Domain' service.

I am able to connect to a standard gmail.com account (using
Jabber::Simple) fine, but when I try connecting to an account on the
alternative domain (let's call it domain.com), I have to use the non-
simple way of doing it so I can set up the JID properly, and I get an
error.

This is the method I'm having a problem with:

11 def initialize(username)
12 @username = username
13 @email = "#{@username}@glam.ac.uk"
14 @password = googlepassword (googlepassword is a method that
returns the unhashed user's password)
15
16 jid = JID::new(@email, "talk.google.com", "Glamlife")
17 cl = Client::new(jid)
18 cl.connect
19 cl.auth(@password)
20 end

I get this error:

Jabber::ClientAuthenticationFailure: closed stream
from /Library/Ruby/Gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:
118:in `auth'
from /Users/mark/Sites/daughter/app/models/gtalk.rb:20:in
`initialize'
from (irb):55:in `new'
from (irb):55
from :0

I have tried changing the cl.auth to cl.auth_nonsasl, to see if that
was the problem, and I get a different error:

IOError: closed stream
from /Library/Ruby/Gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:
346:in `write'
from /Library/Ruby/Gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:
346:in `<<'
from /Library/Ruby/Gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:
346:in `send_data'
from /Library/Ruby/Gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:
344:in `synchronize'
from /Library/Ruby/Gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:
344:in `send_data'
from /Library/Ruby/Gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:
375:in `send'
from /Library/Ruby/Gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:
432:in `send_with_id'
from /Library/Ruby/Gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:
241:in `auth_nonsasl'
from /Users/mark/Sites/daughter/app/models/gtalk.rb:19:in
`initialize'
from (irb):62:in `new'
from (irb):62
from :0

If anyone has any idea what I'm doing wrong (I don't really understand
all the authentication stuff!) I'd be extremely grateful for any
pointers.

Thanks,

Mark
 
Reply With Quote
 
 
 
 
Matthew Slater
Guest
Posts: n/a
 
      09-03-2009

Have you added the necessary DNS records? Detailed here:
http://www.google.com/support/a/bin/...n&answer=34143

MJS


On 3 Sep 2009, at 09:16, Mark wrote:

> I am having problems connecting (using the xmpp4r ruby api) to an
> account on a 'Google Apps for your Domain' service.
>
> I am able to connect to a standard gmail.com account (using
> Jabber::Simple) fine, but when I try connecting to an account on the
> alternative domain (let's call it domain.com), I have to use the non-
> simple way of doing it so I can set up the JID properly, and I get an
> error.
>
> This is the method I'm having a problem with:
>
> 11 def initialize(username)
> 12 @username = username
> 13 @email = "#{@username}@glam.ac.uk"
> 14 @password = googlepassword (googlepassword is a method that
> returns the unhashed user's password)
> 15
> 16 jid = JID::new(@email, "talk.google.com", "Glamlife")
> 17 cl = Client::new(jid)
> 18 cl.connect
> 19 cl.auth(@password)
> 20 end
>
> I get this error:
>
> Jabber::ClientAuthenticationFailure: closed stream
> from /Library/Ruby/Gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:
> 118:in `auth'
> from /Users/mark/Sites/daughter/app/models/gtalk.rb:20:in
> `initialize'
> from (irb):55:in `new'
> from (irb):55
> from :0
>
> I have tried changing the cl.auth to cl.auth_nonsasl, to see if that
> was the problem, and I get a different error:
>
> IOError: closed stream
> from /Library/Ruby/Gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:
> 346:in `write'
> from /Library/Ruby/Gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:
> 346:in `<<'
> from /Library/Ruby/Gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:
> 346:in `send_data'
> from /Library/Ruby/Gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:
> 344:in `synchronize'
> from /Library/Ruby/Gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:
> 344:in `send_data'
> from /Library/Ruby/Gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:
> 375:in `send'
> from /Library/Ruby/Gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:
> 432:in `send_with_id'
> from /Library/Ruby/Gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:
> 241:in `auth_nonsasl'
> from /Users/mark/Sites/daughter/app/models/gtalk.rb:19:in
> `initialize'
> from (irb):62:in `new'
> from (irb):62
> from :0
>
> If anyone has any idea what I'm doing wrong (I don't really understand
> all the authentication stuff!) I'd be extremely grateful for any
> pointers.
>
> Thanks,
>
> Mark
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with XMPP4R with Google Apps for your Domain account Mark Ruby 0 09-02-2009 04:03 PM
How do I Configure .Net V2 to use a domain account for all my apps Danielle Roach ASP .Net Web Services 0 09-14-2007 08:46 AM



Advertisments