dheerajrajjak / google-api-python-client

Automatically exported from code.google.com/p/google-api-python-client
0 stars 0 forks source link

command-line sample do not proceed after oauth2client.tools.run() #126

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
*** What steps will reproduce the problem?

1. run this script with own access information.
    http://code.google.com/p/google-api-python-client/source/browse/samples/latitude/latitude.py

*** What is the expected output? What do you see instead?

Results of "print service.currentLocation().insert(body=body).execute()" should 
be outputted.

*** What version of the product are you using? On what operating system?

oauth2client 1.0beta8
urllib3 1.3
httplib2 0.7.4
Python 2.7.2

*** Please provide any additional information below.

Console do not change with like following message even if I give 
--noauth_local_webserver option to the script, i.e. "python latitude.py 
--noauth_local_webserver":
Go to the following link in your browser:
https://www.google.com/latitude/apps/OAuthAuthorizeToken?scope=https%3A%2F%2Fwww
.googleapis.com%2Fauth%2Flatitude&domain=www.example.com&oauth_token=XXXXXXXXXXX
XXXXXX&location=current&granularity=city

If your browser is on a different machine then exit and re-run this
application with the command-line parameter --noauth_local_webserver.

I think this is due to a bug around gflags option that sets 
auth_local_webserver as False.

Original issue reported on code.google.com by yoshif...@google.com on 17 Apr 2012 at 9:31

GoogleCodeExporter commented 8 years ago
The latitude sample uses OAuth 1.0 instead of 2.0 and contains no call to  
oauth2client.tools.run(), so I'm not sure what this bug report is about.

Original comment by jcgregorio@google.com on 17 Apr 2012 at 12:55

GoogleCodeExporter commented 8 years ago
latitude.py actually is not calling oauth2client.tools.run() but 
apiclient.oauth.run() is the same implementation as oauth2client.tools.run() 
and the same problems happen when we try to implement command-line application 
with oauth2client module.
Could you try moderator.py? 

Original comment by yoshif...@google.com on 17 Apr 2012 at 1:48

GoogleCodeExporter commented 8 years ago
Here is what I get when I run moderator.py both with and w/o that flag:

$ python moderator.py 
Your browser has been opened to visit:

    https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fmoderator&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2F&response_type=code&client_id=4...7.apps.googleusercontent.com&access_type=offline

If your browser is on a different machine then exit and re-run this
application with the command-line parameter 

  --noauth_local_webserver

Created new window in existing browser session.

And also:

$ python moderator.py --noauth_local_webserver
Go to the following link in your browser:

    https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fmoderator&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&client_id=4...7.apps.googleusercontent.com&access_type=offline

Enter verification code: 

Original comment by jcgregorio@google.com on 17 Apr 2012 at 2:02

GoogleCodeExporter commented 8 years ago
You may be running into either a firewall issue blocking ports 8080 and 9090, 
or there are running programs that already using those ports. The tools.run() 
call will silently fall back to using --noauth_local_webserver if neither port 
can be accessed. 

CL out for review http://codereview.appspot.com/6307054/

Now a message will be printed to explain the reason for falling back.

Original comment by jcgregorio@google.com on 7 Jun 2012 at 5:55

GoogleCodeExporter commented 8 years ago
This issue was closed by revision 8f671399d2d0.

Original comment by jcgregorio@google.com on 7 Jun 2012 at 6:31