FlorianHeigl / googlecl

Automatically exported from code.google.com/p/googlecl
0 stars 0 forks source link

-u wrong when logged in as someone else #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I gave it -u foo@gmail.com, then opened the URL in a browser logged in as 
bar@gmail.com.  Now googlecl thinks it's showing me foo's data, but is actually 
showing me bar's.

Maybe googlecl shouldn't use -u at all?

Original issue reported on code.google.com by credenti...@gmail.com on 16 Jun 2010 at 1:53

GoogleCodeExporter commented 9 years ago
I'm torn about this. The best thing would be if the OAuth authorization URL 
could contain the username is expects to get access for, but I haven't been 
able to find documentation about that. Seems like the user just has to read the 
text at the bottom of the authorization page and notice whether or not the 
token is for the correct account.

Original comment by tom.h.mi...@gmail.com on 16 Jun 2010 at 7:41

GoogleCodeExporter commented 9 years ago
Same thing happens when you specify one account on the command line (for 
initial setup) and visit the auth page in a browser already logged in with 
another account.

Original comment by Leigh.Kl...@gmail.com on 17 Jun 2010 at 10:24

GoogleCodeExporter commented 9 years ago
Same thing happened to me. I think soon there will be an API that gives you the 
username for a give access token. With that you don't have to prompt for a 
username at all.

Original comment by marius.s...@gmail.com on 18 Jun 2010 at 7:46

GoogleCodeExporter commented 9 years ago
The API that gives you the email address is already available :-)
http://sites.google.com/site/oauthgoog/Home/emaildisplayscope

For scope, please try (dot instead of hash):
https://www.googleapis.com/auth/userinfo.email

Original comment by marius.s...@gmail.com on 18 Jun 2010 at 11:07

GoogleCodeExporter commented 9 years ago
I finally got around to trying this out! But it doesn't work. Trying it out 
even on the OAuth playground 
(http://googlecodesamples.com/oauth_playground/index.php) gives me an "invalid 
token" error when I try to request data from 
https://www.googleapis.com/userinfo/email

Anyone have any leads / fixes?

Original comment by tom.h.mi...@gmail.com on 28 Jun 2010 at 6:43

GoogleCodeExporter commented 9 years ago
FYI: r306 now includes the email scope, so you can play with this issue from 
the trunk as well.

Original comment by tom.h.mi...@gmail.com on 28 Jun 2010 at 6:52

GoogleCodeExporter commented 9 years ago
I got OAuth Playground working for this. Two minor issues:
- the scope should be https://www.googleapis.com/auth/userinfo#email , the 
endpoint is expecting this scope, even though the two should be equivalent
- at step 6 select text/plain for content-type and "Authorization header" for 
"Stick oauth_* params in"

Original comment by marius.s...@gmail.com on 28 Jun 2010 at 9:10

GoogleCodeExporter commented 9 years ago
I think that did it, Marius. This should be working by this afternoon. Thanks!

Original comment by tom.h.mi...@gmail.com on 29 Jun 2010 at 2:27

GoogleCodeExporter commented 9 years ago
r310 fixes this issue. Thanks for all the help!

Original comment by tom.h.mi...@gmail.com on 29 Jun 2010 at 4:18