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

オープン
#158 コメント 2 件 リアクション 3 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
半日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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).

主要言語
Python
スター
1.4k
フォーク
917
平均マージ
3分
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

googleworkspace/python-samples のほかの issue

googleworkspace/python-samples の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。