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

Abierto
#170 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
30/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
Python
Estrellas
1.4k
Forks
917
Merge medio
3 min
PR fusionados (30 d)
1

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de googleworkspace/python-samples

Todos los issues de googleworkspace/python-samples

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.