admin-sdk report_v1 : Client secret must be for a web or installed app

Đang mở
#170 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
30/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
api, authentication

Hướng nghiên cứu

The traceback points to the quickstart's main.py, where InstalledAppFlow.from_client_secrets_file('credentials.json', SCOPES) rejects a service account key. Check the sample's credential-loading path against the service account flow used in the linked gsuite-exporter tool, and confirm which key type the Reports API call needs. Done means the quickstart authenticates with a service account key and prints report output without the ValueError.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Expected Behavior

in given example code https://developers.google.com/admin-sdk/reports/v1/quickstart/python. We are using service account credentials.

the same service account credentials are working fine in https://github.com/GoogleCloudPlatform/professional-services/tree/master/tools/gsuite-exporter hence we have concluded that its not permission issue with GCP SA or Gsuite admin report API permission.

As per the expected behavior it should print output from report

Actual Behavior

File "main.py", line 28, in main
flow = InstalledAppFlow.from_client_secrets_file('credentials.json', SCOPES)
File "C:\Users\User\AppData\Local\Programs\Python\Python36-32\lib\site-packages\google_auth_oauthlib\flow.py", line 183, in from_client_secrets_file
return cls.from_client_config(client_config, scopes=scopes, **kwargs)
File "C:\Users\User\AppData\Local\Programs\Python\Python36-32\lib\site-packages\google_auth_oauthlib\flow.py", line 156, 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.

Steps to Reproduce the Problem

  1. create function exactly mentioned in the doc https://developers.google.com/admin-sdk/reports/v1/quickstart/python
  2. use service account with Gsuite admin api access as per the setup given https://github.com/GoogleCloudPlatform/professional-services/tree/master/tools/gsuite-exporter
  3. get service account json key and use it in code.

Specifications

  • Python version 3.7
  • Tested in OS Linux, windows and cloud function
Ngôn ngữ chính
Python
Star
1.4k
Fork
917
Merge trung bình
3 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của googleworkspace/python-samples

Tất cả issue của googleworkspace/python-samples

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.