Cannot run python cal sample from container (auth fails)

Ouverte
#139 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
18/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
docker, python
Domaine
authentication

Piste de recherche

The reproduction centers on the quickstart script's local OAuth redirect flow, where the sample starts a local server inside the container and the browser is sent to a random port. Read the flow that picks the redirect port and reproduce by running the Python sample inside a Docker container with a fixed port published. Done would mean a documented or code-level way to complete auth from a host browser, but the issue has no maintainer reply and needs Docker networking and OAuth knowledge.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

enhancement

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.

Langage dominant
Python
Étoiles
1.4k
Forks
917
Merge moyen
3 min
PR mergées (30 j)
1

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de googleworkspace/python-samples

Toutes les issues de googleworkspace/python-samples

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.