auth setup: pasted OAuth Client ID is not trimmed — trailing whitespace causes 401 invalid_client at login
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Stack tecnológico
- rust
- Área
- authentication, cli
Línea de trabajo
Comienza en el manejo de entrada de stage_configure_oauth del asistente de configuración y rastrea cómo se escriben los valores en client_secret.json y se cargan desde las variables de entorno. Verifica el comportamiento con un Client ID y un Client Secret pegados que contengan espacios en blanco circundantes; se considera terminado cuando los valores OAuth almacenados y cargados ya no conservan esos espacios en blanco y el inicio de sesión ya no los envía a Google.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Environment
- gws 0.22.5 (Homebrew
googleworkspace-cli) - macOS 15 (arm64)
Steps to reproduce
- Run the interactive wizard:
gws auth setup --project <project-id> - At Step 5/5 ("OAuth credentials — Waiting for manual input..."), paste a Client ID that ends with a trailing space (very easy to pick up when copying from the Cloud Console credentials page or a chat/notes app)
- Complete the wizard and let it start
gws auth login
What happens
The wizard stores the Client ID verbatim (trailing space included) in ~/.config/gws/client_secret.json:
"client_id": "1234567890-abcdefghij.apps.googleusercontent.com "
The generated authorization URL then contains an encoded trailing space right before the next query parameter:
...&client_id=1234567890-abcdefghij.apps.googleusercontent.com%20&prompt=select_account+consent
Google rejects the request with "The OAuth client was not found." / Error 401: invalid_client, which is quite hard to trace back to an invisible character — the pasted value looks correct in the terminal, and gws auth setup reports success.
Follow-up runs of the wizard pre-fill the stored (dirty) value, so the error persists across re-runs and survives what otherwise looks like a clean re-setup.
Expected behavior
Trim leading/trailing whitespace from the pasted Client ID and Client Secret in the setup wizard input handling (stage_configure_oauth), and ideally also when loading values from client_secret.json / env vars, so a stray space can never produce a misleading invalid_client error.
Workaround
Manually edit ~/.config/gws/client_secret.json and remove the trailing space from client_id, then re-run gws auth login.
- Lenguaje dominante
- Rust
- Estrellas
- 31.1k
- Forks
- 1.8k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de googleworkspace/cli
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
googleworkspace/cli#921 ·
-
Add cli to awesome-ai-plugins? Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
googleworkspace/cli#920 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
googleworkspace/cli#914 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
googleworkspace/cli#858 ·
-
Output of gws <service> <resource> --help provides wrong Usage: format, omitting the <service> part Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
googleworkspace/cli#839 ·
Todos los issues de googleworkspace/cli
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
gitbutlerapp/gitbutler#15998 · 1 comentario ·
-
bug triage:deciding
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
open-telemetry/otel-arrow#4132 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100