quickstart.py: Client secrets must be for a web or installed app.

Aperta
#158 2 commenti 3 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python

Direzione di ricerca

The traceback points to the from_client_secrets_file call near line 31 of the quickstart script (named google_docs.py in the report), which loads credentials.json through google_auth_oauthlib's InstalledAppFlow. Start there and check whether the sample expects an OAuth client file, since a service account key is rejected. Done means either the sample accepts a service account key or the README clearly says which credential type to download. The thread has been silent for about three years, so confirm with a maintainer before starting.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Steps to Reproduce the Problem

  1. Create Service account and download JSON file with credentials
  2. Run quickstart.py

Expected Behavior

The script works just fine, everything works from the box.

Actual Behavior

The traceback:

    Traceback (most recent call last):
  File "google_docs.py", line 46, in <module>
    main()
  File "google_docs.py", line 31, in main
    'credentials.json', SCOPES)
  File "/usr/local/lib/python3.7/site-packages/google_auth_oauthlib/flow.py", line 199, in from_client_secrets_file
    return cls.from_client_config(client_config, scopes=scopes, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/google_auth_oauthlib/flow.py", line 159, in from_client_config
    'Client secrets must be for a web or installed app.')
ValueError: Client secrets must be for a web or installed app.

Specifications

  • Python version
    Python 3.7.4
  • OS: Mac

Workaround:
The workaround I've found for this issue:
https://stackoverflow.com/a/61892378/7856072
(this workaround proves that credentials.json is the correct file for authorization and account has all necessary rights).

Lingua principale
Python
Stelle
1.4k
Fork
917
Merge medio
3m
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di googleworkspace/python-samples

Tutte le issue di googleworkspace/python-samples

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.