python-samples icon indicating copy to clipboard operation
python-samples copied to clipboard

Cannot run python cal sample from container (auth fails)

Open drewkhoury opened this issue 5 years ago • 1 comments

Expected Behavior

When I try to run the python cal sample from within a container it should allow me to auth successfully.

Actual Behavior

The terminal (in container) provides an "offline url" which when clicked (on desktop) redirects to a random high port that is not available from the desktop.

e.g: Clicking "Allow" will redirect you to: http://localhost:46603 Clicking "Allow" will redirect you to: http://localhost:40391

Steps to Reproduce the Problem

  1. docker run -it python bash
  2. container> pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
  3. container> python quickstart.py
  4. host (chrome)> Please visit this URL to authorize this application: https://accounts.google.com/o/oauth2/auth?...&access_type=offline
  5. Auth, then the redirect will fail

Note: Have also tried modifying the auth code to run on port 8080 and expose that port in the container. Have also confirmed that the port is exposed with a test of "python -m http.server 8080" in the container.

drewkhoury avatar Jan 19 '20 22:01 drewkhoury