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

Aberta
#170 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
30/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Estagnada
Stack de tecnologia
python
Domínio
api, authentication

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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
Linguagem predominante
Python
Estrelas
1.4k
Forks
917
Merge médio
3min
PRs com merge (30d)
1

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de googleworkspace/python-samples

Todas as issues de googleworkspace/python-samples

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.