fix: googlechat auth token sourcing

This commit is contained in:
iHildy committed 2026-01-26 20:16:03 -06:00
1 parent ec4088c76c
commit 66c10e9562
5 files changed
+64 -51

No files matched your search

+5 -5
View File
@@ -51,7 +51,7 @@ Service accounts cover most bot workflows, but **reactions and user-attributed a
### Option A: Use gog OAuth (recommended if you already use `gog`)
If you already use `gog` for Google Workspace, you can reuse its OAuth client + refresh token.
`gog` stores the OAuth client credentials JSON in your config directory and the refresh token in your system keyring. citeturn9view0turn6view0
`gog` stores the OAuth client credentials JSON in your config directory and the refresh token in your system keyring.
1) Ensure `gog` is already authorized:
```bash
@@ -73,8 +73,8 @@ If you already use `gog` for Google Workspace, you can reuse its OAuth client +
}
```
3) Ensure `gog` can access its keyring on the gateway host.
- `gog` stores refresh tokens in the system keychain by default (not inside `credentials.json`). citeturn6view0
- For headless systems (systemd, SSH-only), switch to file keyring + password (see `gog` docs). citeturn6view0
- `gog` stores refresh tokens in the system keychain by default (not inside `credentials.json`).
- For headless systems (systemd, SSH-only), switch to file keyring + password (see `gog` docs).
- Set `GOG_KEYRING_BACKEND=file` and `GOG_KEYRING_PASSWORD=...` for the gateway service.
- The file keyring lives under your gog config directory (for example `~/.config/gogcli/keyring/`).
4) Verify `gog` is visible to the gateway user:
@@ -87,12 +87,12 @@ If you already use `gog` for Google Workspace, you can reuse its OAuth client +
Clawdbot reads `gog` OAuth client files from:
- `~/.config/gogcli/credentials.json`
- `~/.config/gogcli/credentials-<client>.json`
- `~/.config/gogcli/credentials-<domain>.json` (or macOS equivalent) citeturn9view0
- `~/.config/gogcli/credentials-<domain>.json` (or macOS equivalent)
Clawdbot queries `gog auth tokens list --json` to discover which account to use, then runs `gog auth tokens export <email> --out <tmp>` to read the refresh token. If you have multiple gog accounts, set `gogAccount` (or `GOG_ACCOUNT`) to pick the right one. If this fails, set `oauthRefreshToken` manually.
### Option B: Manual OAuth
1) Configure OAuth consent + create OAuth client credentials in your Google Cloud project (desktop app recommended). citeturn6view0
1) Configure OAuth consent + create OAuth client credentials in your Google Cloud project (desktop app recommended).
2) Use an OAuth 2.0 flow to request **offline** access and collect a refresh token.
- Required scopes for reactions include:
- `https://www.googleapis.com/auth/chat.messages.reactions.create`