admin-sdk report_v1 : Client secret must be for a web or installed app
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
- create function exactly mentioned in the doc https://developers.google.com/admin-sdk/reports/v1/quickstart/python
- use service account with Gsuite admin api access as per the setup given https://github.com/GoogleCloudPlatform/professional-services/tree/master/tools/gsuite-exporter
- get service account json key and use it in code.
Specifications
- Python version 3.7
- Tested in OS Linux, windows and cloud function