quickstart.py fails when Firefox is default browser on Mac
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 1-2 天
- 新手友好度
- 25/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- python
研究方向
The failure starts at flow.run_local_server(port=0) in quickstart.py, line 33, and the traceback runs through google_auth_oauthlib/flow.py into oauthlib's parameters.py, where MismatchingStateError is raised. Reproduce with Firefox as the default browser on macOS, then check whether the state value is lost or altered on the localhost redirect. Done means either a working sample under Firefox or a documented workaround.
由索引模型根據 Issue 內容生成。
描述
Expected Behavior
Please visit this URL to authorize this application: https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=xxx.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A63472%2F&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fgmail.readonly&state=xxx&access_type=offline
Then browser opens URL and user authenticates to account then token.pickle gets created and the following gets displayed
Labels:
CHAT
SENT
INBOX
IMPORTANT
TRASH
DRAFT
SPAM
CATEGORY_FORUMS
CATEGORY_UPDATES
CATEGORY_PERSONAL
CATEGORY_PROMOTIONS
CATEGORY_SOCIAL
STARRED
UNREAD
Actual Behavior
Please visit this URL to authorize this application: https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=xxx.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A63472%2F&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fgmail.readonly&state=xxx&access_type=offline
Then browser opens URL and user authenticates to account
Traceback (most recent call last):
File "quickstart.py", line 53, in
main()
File "quickstart.py", line 33, in main
creds = flow.run_local_server(port=0)
File "/Users/username/.virtualenvs/bpaml-email/lib/python3.8/site-packages/google_auth_oauthlib/flow.py", line 460, in run_local_server
self.fetch_token(authorization_response=authorization_response)
File "/Users/username/.virtualenvs/bpaml-email/lib/python3.8/site-packages/google_auth_oauthlib/flow.py", line 280, in fetch_token
return self.oauth2session.fetch_token(
File "/Users/username/.virtualenvs/bpaml-email/lib/python3.8/site-packages/requests_oauthlib/oauth2_session.py", line 239, in fetch_token
self._client.parse_request_uri_response(
File "/Users/username/.virtualenvs/bpaml-email/lib/python3.8/site-packages/oauthlib/oauth2/rfc6749/clients/web_application.py", line 203, in parse_request_uri_response
response = parse_authorization_code_response(uri, state=state)
File "/Users/username/.virtualenvs/bpaml-email/lib/python3.8/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 268, in parse_authorization_code_response
raise MismatchingStateError()
oauthlib.oauth2.rfc6749.errors.MismatchingStateError: (mismatching_state) CSRF Warning! State not equal in request and response.
token.pickle file is not created
Steps to Reproduce the Problem
- Set Firefox as default browser
- python3 quickstart.py
Specifications
- Python version (
python --version) Python 3.8.2 - OS (Mac 10.14.6)
- Firefox 76.0.1
Setting the default browser to Safari or Google Chrome achieved the expected behaviour
- 主要語言
- Python
- 星號
- 1.4k
- 分支
- 917
- 平均合併
- 3 分鐘
- 30 天內合併 PR
- 1
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
googleworkspace/python-samples 的其他 Issue
-
ايقاف البحث الأمن可能重新可做 @sqrrrl 於 400 天前認領,目前沒有進行中的 PR。 未關閉
googleworkspace/python-samples#2434 · 已指派 1 人 ·
-
Slow Uploads using Google Drive API with Python可能重新可做 @sqrrrl 於 740 天前認領,目前沒有進行中的 PR。 未關閉
googleworkspace/python-samples#1852 · 1 則留言 · 已指派 1 人 ·
-
403 error from google after a few successful runs of my code可能重新可做 @vinay-google 於 912 天前認領,目前沒有進行中的 PR。 未關閉
googleworkspace/python-samples#1424 · 已指派 1 人 ·
-
How to see the progress of files which is getting uploaded可能重新可做 @vinay-google 於 928 天前認領,目前沒有進行中的 PR。 未關閉
googleworkspace/python-samples#1404 · 已指派 1 人 ·
-
Phyton Samples可能重新可做 @PierrickVoulet 於 975 天前認領,目前沒有進行中的 PR。 未關閉
googleworkspace/python-samples#1279 · 已指派 1 人 ·
查看 googleworkspace/python-samples 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 88/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
readthedocs/readthedocs-builder#73 ·
維護者通常 1 天內回覆
-
area: ci bug good first issue help wanted
難度 2/5 1-3 小時 新手友好度 84/100
hffgzktbcc-blip/ounce-core#484 · 1 則留言 ·
維護者通常 1 天內回覆
-
bug documentation
難度 2/5 1-3 小時 新手友好度 73/100
vllm-project/vllm-torchtpu#3395 ·
維護者通常 1 天內回覆
-
Hermes plugin: MITM-domain discovery misses the model: block (provider/base_url nested under model:) — traffic blind-tunnels silently, zero compression可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉bug
難度 2/5 1-3 小時 新手友好度 66/100
ranxianglei/billion-context#7063 ·
維護者通常 1 天內回覆