bug: `gws auth setup` writes double-serialized client_id/client_secret into client_secret.json (causes 401 invalid_client)

Ouverte
#947 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
68/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
rust
Domaine
authentication, cli

Piste de recherche

Start by reproducing the issue with gws auth setup and inspect the generated ~/.config/gws/client_secret.json, focusing on how the OAuth credentials are serialized. Confirm the fix by checking that client_id and client_secret contain plain values and that a subsequent gws auth login succeeds without invalid_client.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

gws version: 0.22.5 (installed via npm on Windows 10)

Steps to reproduce:

  1. Run gws auth setup
  2. Complete gcloud auth login when prompted
  3. Choose "Create new project"
  4. Let the wizard finish (creates OAuth client, writes ~/.config/gws/client_secret.json)
  5. Run gws auth login

Actual behavior:
The generated client_secret.json has its client_id and client_secret fields filled with the entire JSON credentials object (double-serialized as a string) instead of the plain values:

{
  "installed": {
    "client_id": "{\"installed\":{\"client_id\":\"123-abc.apps.googleusercontent.com\",...,\"client_secret\":\"REDACTED\",...}}",
    "client_secret": "{\"installed\":{...same blob...}}"
  }
}

This causes every subsequent gws auth login attempt to fail with:

error[auth]: OAuth flow failed: Server error: invalid_client: The OAuth client was not found.

The printed "Open this URL in your browser to authenticate" link also contains the malformed client_id query param, so manually fixing the URL alone does not help until the underlying file is fixed.

Workaround:
Manually edit client_secret.json and replace client_id/client_secret with the actual plain values extracted from the nested string, then gws auth login works correctly.

Expected behavior:
gws auth setup should write the plain client_id/client_secret strings, not a re-serialized copy of the whole credentials object.

Langage dominant
Rust
Étoiles
32.3k
Forks
2k
Merge moyen
16 h 3 min
PR mergées (30 j)
1

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de googleworkspace/cli

Toutes les issues de googleworkspace/cli

Issues similaires

Plus d'issues Rust

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.