Cannot run python cal sample from container (auth fails)

未关闭
#139 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
18/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
docker, python

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Python
星标
1.4k
派生
917
平均合并
3 分钟
30 天内合并 PR
1

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

googleworkspace/python-samples 的其他 Issue

查看 googleworkspace/python-samples 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。