ip2k / google-api-ruby-client

Automatically exported from code.google.com/p/google-api-ruby-client
Apache License 2.0
0 stars 0 forks source link

Command line -- Docs out of date and 2LO no longer works #9

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try using 2LO with the command line
 a) google-api oauth-1-login --client-id XXXXX --client-secret YYYY
 b) google-api execute --uri 'https://picasaweb.google.com/data/feed/api/user/default?v=2' --requestor-id ZZZZZZ

What is the expected output? What do you see instead?
/Users/sbazyl/.rvm/gems/ruby-1.9.2-p180/gems/signet-0.2.2/lib/signet/oauth_1/cli
ent.rb:888:in `block in generate_authenticated_request': token_credential_key 
was not set. (ArgumentError)
    from /Users/sbazyl/.rvm/gems/ruby-1.9.2-p180/gems/signet-0.2.2/lib/signet/oauth_1/client.rb:886:in `each'
    from /Users/sbazyl/.rvm/gems/ruby-1.9.2-p180/gems/signet-0.2.2/lib/signet/oauth_1/client.rb:886:in `generate_authenticated_request'
    from /Users/sbazyl/.rvm/gems/ruby-1.9.2-p180/gems/google-api-client-0.2.0/lib/google/api_client.rb:586:in `generate_authenticated_request'
    from /Users/sbazyl/.rvm/gems/ruby-1.9.2-p180/gems/google-api-client-0.2.0/bin/google-api:449:in `execute'
    from /Users/sbazyl/.rvm/gems/ruby-1.9.2-p180/gems/google-api-client-0.2.0/bin/google-api:182:in `parse!'
    from /Users/sbazyl/.rvm/gems/ruby-1.9.2-p180/gems/google-api-client-0.2.0/bin/google-api:518:in `<top (required)>'
    from /Users/sbazyl/.rvm/gems/ruby-1.9.2-p180/bin/google-api:19:in `load'
    from /Users/sbazyl/.rvm/gems/ruby-1.9.2-p180/bin/google-api:19:in `<main>'

Original issue reported on code.google.com by sba...@google.com on 4 Jun 2011 at 1:13

GoogleCodeExporter commented 9 years ago
Which docs were out of date? I totally believe that 2LO broke, since I 
basically never use it myself. Dan Holevoet is the main person who worries 
about 2LO w/ the client. Catch me when I'm online and we can go figure out what 
went wrong.

Original comment by bobaman@google.com on 18 Jun 2011 at 4:10

GoogleCodeExporter commented 9 years ago
2LO still works, just busted in the CL tool.

The doc that is out of date is 
http://code.google.com/p/google-api-ruby-client/wiki/CommandLine.  Specifically:
1) The command oauth-login doesn't exist.  It is now split into oauth-1-login 
and oauth-2-login
2) The option --client-key was renamed to --client-id

Anyway, the fix for google-api is pretty minor, just making sure the auth 
mechanism is set correctly (and fix a nil object reference when appending 
xoauth_requestor_id to URLs that lack a query string).  See the attached diff 
or let me know if you just want me to submit the CL and fix the docs.

Original comment by sba...@google.com on 8 Jul 2011 at 1:29

Attachments:

GoogleCodeExporter commented 9 years ago
Submitted fix & updated docs.

Original comment by sba...@google.com on 8 Jul 2011 at 7:15

GoogleCodeExporter commented 9 years ago
I'm not 100% certain about this fix. The second block looks good, but the first 
part looks suspect. But until someone else says there's a problem, I'm inclined 
to just leave it as-is for now.

Original comment by bobaman@google.com on 18 Jul 2011 at 6:08

GoogleCodeExporter commented 9 years ago
I hit this too, and confirm fix.

Original comment by ttrox...@gmail.com on 21 Aug 2012 at 4:47