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

未關閉
#336 0 則留言 0 個 reaction 已指派 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 分鐘
30 天內合併 PR
1

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

googleworkspace/python-samples 的其他 Issue

查看 googleworkspace/python-samples 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。