Credentials.from_authorized_user_file refresh_token is missing
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 25/100
- Issue-Typ
- Dokumentation
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- json, python
- Bereich
- authentication
Rechercherichtung
The traceback points to quickstart.py calling Credentials.from_authorized_user_file('token.json', SCOPES), which raises from from_authorized_user_info in google/oauth2/credentials.py. The reporter's token.json is a downloaded OAuth client secrets file with an 'installed' key, not an authorized-user token, so start by checking how the quickstart tells users to create token.json. Done means the quickstart or its error path makes that mistake clear, which needs a maintainer decision on the intended fix.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Expected Behavior
quickstart.py script will give me the last 10 login as described here:
https://developers.google.com/admin-sdk/reports/v1/quickstart/python
Actual Behavior
I'm trying to run the quickstart.py with a downloaded token.json for Desktop apps.
{
"installed": {
"client_id": "************.apps.googleusercontent.com",
"project_id": "sentinel-314815",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_secret": "*************",
"redirect_uris": [
"urn:ietf:wg:oauth:2.0:oob",
"http://localhost"
]
}
}
It gives me the following erro:
$ python quickstart.py
Traceback (most recent call last):
File "quickstart.py", line 50, in <module>
main()
File "quickstart.py", line 20, in main
creds = Credentials.from_authorized_user_file('token.json', SCOPES)
File "/home/zfejer/.local/lib/python3.8/site-packages/google/oauth2/credentials.py", line 326, in from_authorized_user_file
return cls.from_authorized_user_info(data, scopes)
File "/home/zfejer/.local/lib/python3.8/site-packages/google/oauth2/credentials.py", line 277, in from_authorized_user_info
raise ValueError(
ValueError: Authorized user info was not in the expected format, missing fields client_secret, client_id, refresh_token.
Seems like the refresh_token is missing from my token.json. I've just generated the token.json.
Steps to Reproduce the Problem
- follow the instruction on the page above
Specifications
- Python version (
python --version) Python 3.8.5 - OS (Mac/Linux/Windows) Ubuntu 20.04 on WSL2 (5.4.72-microsoft-standard-WSL2)
- 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
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
readthedocs/readthedocs-builder#73 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area: ci bug good first issue help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
hffgzktbcc-blip/ounce-core#484 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 73/100
vllm-project/vllm-torchtpu#3395 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Hermes plugin: MITM-domain discovery misses the model: block (provider/base_url nested under model:) — traffic blind-tunnels silently, zero compressionEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
ranxianglei/billion-context#7063 ·
Maintainer antworten meist innerhalb von 1 Tag