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

オープン
#947 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Rust
スター
32.3k
フォーク
2k
平均マージ
16時間 3分
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

googleworkspace/cli のほかの issue

googleworkspace/cli の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。