Using service account with domain-wide delegation still causing error "Precondition check failed"

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

@vinay-google がすでに取り組んでいます。

2022年7月8日 から。

  • #337 @jackred8 による — マージされずにクローズ

評価

この issue はまだ評価されていません。

説明

Summary

If using a service account with domain-wide authority delegation, run this python sample code with userId=me or any email address within the organization, it will return an error:

{'message': 'Precondition check failed.', 'domain': 'global', 'reason': 'failedPrecondition'}

Expected Behavior

Service account with correct scopes should be able to access any userIds

Actual Behavior

Service account with correct scopes always gets error

{'message': 'Precondition check failed.', 'domain': 'global', 'reason': 'failedPrecondition'}

Steps to Reproduce the Problem

Follow the instructions here https://developers.google.com/admin-sdk/directory/v1/guides/delegation#python

  1. Create the service account and credentials
  2. Delegate domain-wide authority to your service account
  3. Assign the correct scopes according to here https://developers.google.com/gmail/api/reference/rest/v1/users.settings.sendAs/list
  4. Run the code from here https://github.com/googleworkspace/python-samples/blob/master/gmail/snippet/settings%20snippets/update_signature.py

Specifications

  • Python 3.7.3
  • macOS Monterey Version 12.3.1
主要言語
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 を短くまとめたダイジェスト。