quickstart.py fails when Firefox is default browser on Mac
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 25/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- python
- Bereich
- authentication
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- Python
- Sterne
- 1.4k
- Forks
- 917
- Ø Merge
- 3 Min.
- Gemergte PRs (30 T.)
- 1
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus googleworkspace/python-samples
-
ايقاف البحث الأمنEvtl. wieder frei @sqrrrl hat das vor 400 Tagen übernommen, und es ist kein Pull Request offen. Offen
googleworkspace/python-samples#2434 · 1 zugewiesene Person ·
-
Slow Uploads using Google Drive API with PythonEvtl. wieder frei @sqrrrl hat das vor 740 Tagen übernommen, und es ist kein Pull Request offen. Offen
googleworkspace/python-samples#1852 · 1 Kommentar · 1 zugewiesene Person ·
-
403 error from google after a few successful runs of my codeEvtl. wieder frei @vinay-google hat das vor 912 Tagen übernommen, und es ist kein Pull Request offen. Offen
googleworkspace/python-samples#1424 · 1 zugewiesene Person ·
-
How to see the progress of files which is getting uploadedEvtl. wieder frei @vinay-google hat das vor 928 Tagen übernommen, und es ist kein Pull Request offen. Offen
googleworkspace/python-samples#1404 · 1 zugewiesene Person ·
-
Phyton SamplesEvtl. wieder frei @PierrickVoulet hat das vor 975 Tagen übernommen, und es ist kein Pull Request offen. Offen
googleworkspace/python-samples#1279 · 1 zugewiesene Person ·
Alle Issues in googleworkspace/python-samples
Ähnliche Issues
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
canonical/paas-charm#407 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 5 Tagen
-
bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
FAIRmat-NFDI/pynxtools-spm#136 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement tooling
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
Maintainer antworten meist innerhalb von 1 Tag
-
`read_nexus` entry point points to a function that no longer existsEvtl. vergeben @RubelMozumder hat das heute übernommen. Offenannotator bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
FAIRmat-NFDI/pynxtools#876 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug]: HTTP 499 (Client Closed Request) is classified as a non-retryable format_error, so a mid-flight abort fails the turn over instead of retryingEvtl. vergeben @yipinghuang1991 hat das heute übernommen. Offencomp/agent P2 type/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
NousResearch/hermes-agent#156837 ·
Maintainer antworten meist innerhalb von 1 Tag