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

Unable to authenticate with simple login(?) #126

Open
cboettig opened this issue Aug 23, 2012 · 19 comments
Open

Unable to authenticate with simple login(?) #126

cboettig opened this issue Aug 23, 2012 · 19 comments

Comments

@cboettig
Copy link

The simple login throws an error I don't understand:

Garb::Session.login("myuser", "mypassword")
Garb::AuthenticationRequest::AuthError: Garb::AuthenticationRequest::AuthError
    from /var/lib/gems/1.9.1/gems/garb-0.9.1/lib/garb/authentication_request.rb:37:in `block in send_request'
    from /usr/lib/ruby/1.9.1/net/http.rb:1322:in `block (2 levels) in transport_request'
    from /usr/lib/ruby/1.9.1/net/http.rb:2671:in `reading_body'
    from /usr/lib/ruby/1.9.1/net/http.rb:1321:in `block in transport_request'
    from /usr/lib/ruby/1.9.1/net/http.rb:1316:in `catch'
    from /usr/lib/ruby/1.9.1/net/http.rb:1316:in `transport_request'
    from /usr/lib/ruby/1.9.1/net/http.rb:1293:in `request'
    from /usr/lib/ruby/1.9.1/net/http.rb:1286:in `block in request'
    from /usr/lib/ruby/1.9.1/net/http.rb:745:in `start'
    from /usr/lib/ruby/1.9.1/net/http.rb:1284:in `request'
    from /var/lib/gems/1.9.1/gems/garb-0.9.1/lib/garb/authentication_request.rb:36:in `send_request'
    from /var/lib/gems/1.9.1/gems/garb-0.9.1/lib/garb/authentication_request.rb:49:in `auth_token'
    from /var/lib/gems/1.9.1/gems/garb-0.9.1/lib/garb/session.rb:10:in `login'
    from (irb):3
    from /usr/bin/irb:12:in `<main>'

any idea what I'm doing wrong here?

Sija referenced this issue in Sija/garb Aug 23, 2012
- Fixed Garb::VERSION -> Garb::Version typo in single user authorization
- Fixes #126
@Sija
Copy link

Sija commented Aug 23, 2012

Seems like bad credentials, but it might be a problem with the library itself.
Try my fork, i just checked and it (still) works!

@cboettig
Copy link
Author

Um, perhaps this is caused by me having the 2-step authentication configured for Google? Have you tested this function when 2-step authentication is active?

@Sija
Copy link

Sija commented Aug 23, 2012

Did you set Garb.api_key (obtainable from Google APIs Console) ?
More here and here.

@cboettig
Copy link
Author

Ah, that must be it. But not recognizing the Garb.api_key function.

irb(main):017:0> Garb.api_key
NoMethodError: undefined method `api_key' for Garb:Module

@Sija
Copy link

Sija commented Aug 23, 2012

Try using my fork as this one is, you could say… slightly dated ;)

@cboettig
Copy link
Author

I'm a bit rusty on manual gem install from source, I've just been using
sudo gem install. I clone your repo and run bundle install there?

On Thu, Aug 23, 2012 at 12:53 PM, Sijawusz Pur Rahnama <
notifications@github.com> wrote:

Try using my fork as this one is, you could say… slightly dated ;)


Reply to this email directly or view it on GitHubhttps://github.com/vigetlabs/garb/issues/126#issuecomment-7981915.

Carl Boettiger
UC Davis
http://www.carlboettiger.info/

@Sija
Copy link

Sija commented Aug 23, 2012

There's good howto over at invaluable SO — http://stackoverflow.com/questions/2577346/how-to-install-gem-from-github-source

@adamthedeveloper
Copy link

Thanks Sija for continuing to support this Gem. I was able to get the Api key to work. I was getting the error:

Garb::DataRequest::ClientError: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><errors xmlns=\"http://schemas.google.com/g/2005\"><error><domain>usageLimits</domain><code>userRateLimitExceededUnreg</code><internalReason>User Rate Limit Exceeded. Please sign up</internalReason><extendedHelp>https://code.google.com/apis/console</extendedHelp></error></errors>"

If anyone else is getting this, you need to first install Sija's fork of this gem:

# Inside Gemfile
gem 'garb', :git => "git://github.com/Sija/garb.git"

Follow this with

bundle update

Next, set your api key like this:

Garb::Session.api_key = 'your_api_key'
Garb::Session.login(username, password)

After that, the error I was getting above went away.

I am a big fan of "hold my hand" sometimes - sorry if there are too many details here - but the documentation isn't great.

@cboettig
Copy link
Author

Thanks! Got the 0.9.5 version installed from Sija's gem, and entered the api key, but I'm still getting stuck on the Garb::Session.login step.

Error trace isn't particularly helpful:

Garb::AuthError: Garb::AuthError
    from /var/lib/gems/1.9.1/gems/garb-0.9.5/lib/garb/request/authentication.rb:38:in `block in send_request'
    from /usr/lib/ruby/1.9.1/net/http.rb:1322:in `block (2 levels) in transport_request'
    from /usr/lib/ruby/1.9.1/net/http.rb:2671:in `reading_body'
    from /usr/lib/ruby/1.9.1/net/http.rb:1321:in `block in transport_request'
    from /usr/lib/ruby/1.9.1/net/http.rb:1316:in `catch'
    from /usr/lib/ruby/1.9.1/net/http.rb:1316:in `transport_request'
    from /usr/lib/ruby/1.9.1/net/http.rb:1293:in `request'
    from /usr/lib/ruby/1.9.1/net/http.rb:1286:in `block in request'
    from /usr/lib/ruby/1.9.1/net/http.rb:745:in `start'
    from /usr/lib/ruby/1.9.1/net/http.rb:1284:in `request'
    from /var/lib/gems/1.9.1/gems/garb-0.9.5/lib/garb/request/authentication.rb:37:in `send_request'
    from /var/lib/gems/1.9.1/gems/garb-0.9.5/lib/garb/request/authentication.rb:50:in `auth_token'
    from /var/lib/gems/1.9.1/gems/garb-0.9.5/lib/garb/session.rb:10:in `login'
    from (irb):5
    from /usr/bin/irb:12:in `<main>'

thanks again for any suggestions on how to debug this.

@Sija
Copy link

Sija commented Oct 2, 2012

@cboettig It seems you provided wrong credentials.
Ensure that provided password/api_key are correct.
I just checked from console and it works.

@cboettig
Copy link
Author

cboettig commented Oct 2, 2012

Just to make sure, the key I want is the one from
https://code.google.com/apis/console/ where it says:

Simple API Access

Use API keys to identify your project when you do not need to access user
data. Learn more http://code.google.com/apis/console-help/#UsingKeys
Key for browser apps (with referers)API key: MY-KEY-XXXX

On Tue, Oct 2, 2012 at 2:01 AM, Sijawusz Pur Rahnama <
notifications@github.com> wrote:

@cboettig https://github.com/cboettig It seems you provided wrong
credentials.
Ensure that provided password/api_key are correct.
I just checked from console and it works.


Reply to this email directly or view it on GitHubhttps://github.com/vigetlabs/garb/issues/126#issuecomment-9063110.

Carl Boettiger
UC Davis
http://www.carlboettiger.info/

@antho1404
Copy link

Got the same error that's make me crazy, did you found any solution ?
I spend two hours to test every solutions found on internet withou success

@cboettig
Copy link
Author

Are you using sija's fork? That worked for me once I entered the Ali key.
I never got it working on my Google account that has the two step (text
msg) authentication. Instead I created a second fight account with one
step sub and then shared the Analytics report with that account.
On Jan 27, 2013 8:40 AM, "Anthony" notifications@github.com wrote:

Got the same error that's make me crazy, did you found any solution ?
I spend two hours to test every solutions found on internet withou success


Reply to this email directly or view it on GitHubhttps://github.com/vigetlabs/garb/issues/126#issuecomment-12756893.

@antho1404
Copy link

Thx for the answer, I tested sija's fork but with my personnal Google account, I will also try to create a "fake" account and I will pray ;)

@mavericreal
Copy link

It didn't work with the two step authentication but worked fine with a new account.

@analyticsPierce
Copy link

You need to add the application in the two-step security setup in Google
first. Log into your Google account and go to security. Go through the
steps to add a new application and it will generate a new password just
for that.

Good luck.

Pierce

Raul Sann wrote:

It didn't work with the two step authentication but worked fine with a
new account.


Reply to this email directly or view it on GitHub
https://github.com/vigetlabs/garb/issues/126#issuecomment-13756712.

ascandella referenced this issue in ascandella/garb Mar 11, 2013
- Fixed Garb::VERSION -> Garb::Version typo in single user authorization
- Fixes #126
@supadhyaya
Copy link

well I am stuck with this again :( can anyone tell me what are the API_KEY ?

  1. need to pass into Garb::Session.API_KEY= 'somewhere/in/directory/API_KEY.p12' .. ?
  2. Then Garb::Session.login('xyz@gmail.com','gmail_password') ?

@manishnagdewani96170
Copy link

I am stuck with single login after enable 2-step authentication too and also have taken fork of Sija/garb still it is not working.Can anyone help me here?

@Haseeb717
Copy link

Garb::AuthError: Garb::AuthError from /home/haseeb/.rvm/gems/ruby-2.0.0-p648/bundler/gems/garb-ee888166b9a0/lib/garb/request/authentication.rb:38:in block in send_request'
from /home/haseeb/.rvm/rubies/ruby-2.0.0-p648/lib/ruby/2.0.0/net/http.rb:1419:in block (2 levels) in transport_request' from /home/haseeb/.rvm/rubies/ruby-2.0.0-p648/lib/ruby/2.0.0/net/http/response.rb:162:in reading_body'
from /home/haseeb/.rvm/rubies/ruby-2.0.0-p648/lib/ruby/2.0.0/net/http.rb:1418:in block in transport_request' from /home/haseeb/.rvm/rubies/ruby-2.0.0-p648/lib/ruby/2.0.0/net/http.rb:1409:in catch'
from /home/haseeb/.rvm/rubies/ruby-2.0.0-p648/lib/ruby/2.0.0/net/http.rb:1409:in transport_request' from /home/haseeb/.rvm/rubies/ruby-2.0.0-p648/lib/ruby/2.0.0/net/http.rb:1382:in request'
from /home/haseeb/.rvm/gems/ruby-2.0.0-p648/gems/rest-client-1.6.7/lib/restclient/net_http_ext.rb:51:in request' from /home/haseeb/.rvm/rubies/ruby-2.0.0-p648/lib/ruby/2.0.0/net/http.rb:1375:in block in request'
from /home/haseeb/.rvm/rubies/ruby-2.0.0-p648/lib/ruby/2.0.0/net/http.rb:852:in start' from /home/haseeb/.rvm/rubies/ruby-2.0.0-p648/lib/ruby/2.0.0/net/http.rb:1373:in request'
from /home/haseeb/.rvm/gems/ruby-2.0.0-p648/gems/rest-client-1.6.7/lib/restclient/net_http_ext.rb:51:in request' from /home/haseeb/.rvm/gems/ruby-2.0.0-p648/bundler/gems/garb-ee888166b9a0/lib/garb/request/authentication.rb:37:in send_request'
from /home/haseeb/.rvm/gems/ruby-2.0.0-p648/bundler/gems/garb-ee888166b9a0/lib/garb/request/authentication.rb:50:in auth_token' from /home/haseeb/.rvm/gems/ruby-2.0.0-p648/bundler/gems/garb-ee888166b9a0/lib/garb/session.rb:10:in login'
from (irb):21
from /home/haseeb/.rvm/gems/ruby-2.0.0-p648/gems/railties-3.2.14/lib/rails/commands/console.rb:47:in start' from /home/haseeb/.rvm/gems/ruby-2.0.0-p648/gems/railties-3.2.14/lib/rails/commands/console.rb:8:in start'
from /home/haseeb/.rvm/gems/ruby-2.0.0-p648/gems/railties-3.2.14/lib/rails/commands.rb:41:in <top (required)>' from script/rails:6:in require'
from script/rails:6:in <main>'2.0.0-p648 :022 >

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

9 participants