Fosome / garb

A Ruby wrapper for the Google Analytics API
http://www.viget.com/extend/
654 stars 89 forks source link

Garb::AuthenticationRequest::AuthError when trying to login recently #97

Closed zealot128 closed 13 years ago

zealot128 commented 13 years ago

Hello,

today I checked, if our GA script is still running, turns out, it is not

>> require "garb" 
>> Garb::Session.login("xxxx","xxxx")
Garb::AuthenticationRequest::AuthError: Garb::AuthenticationRequest::AuthError
        from /usr/lib/ruby/gems/1.8/gems/garb-0.9.1/lib/garb/authentication_request.rb:39:in `send_request'
        from /usr/lib/ruby/1.8/net/http.rb:1053:in `request'
        from /usr/lib/ruby/1.8/net/http.rb:2136:in `reading_body'
        from /usr/lib/ruby/1.8/net/http.rb:1052:in `request'
        from /usr/lib/ruby/1.8/net/http.rb:1037:in `request'
        from /usr/lib/ruby/1.8/net/http.rb:543:in `start'
        from /usr/lib/ruby/1.8/net/http.rb:1035:in `request'
        from /usr/lib/ruby/gems/1.8/gems/garb-0.9.1/lib/garb/authentication_request.rb:36:in `send_request'
        from /usr/lib/ruby/gems/1.8/gems/garb-0.9.1/lib/garb/authentication_request.rb:51:in `auth_token'
        from /usr/lib/ruby/gems/1.8/gems/garb-0.9.1/lib/garb/session.rb:10:in `login'

instead of HTTPOK, the response is:
#<Net::HTTPForbidden 403 Forbidden readbody=false>

I double-checked the credentials via copy&paste, they are correct. I tryed garb 0.9.0 and 0.9.1.

Thank you for your time!

tpitale commented 13 years ago

Which version of ruby?

I'm on 1.9.2 and I am have no issues with either of those versions.

If your authentication is incorrect, you'll get Garb::AuthenticationRequest::AuthError, so that would seem to be your problem. Perhaps there is some issue with the transition between google apps and normal google accounts?

You can pass in an option for the account_type to the login method. This value defaults to HOSTED_OR_GOOGLE, which should handle everyone, unless there is some strange collision in your email address.

zealot128 commented 13 years ago

OK, I checked 2 different machines with different Rubies. It seems to be depent on the server/IP, maybe this specific IP is blocked by Google Analytics. Thank you