-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Description
Description
When switching between multiple Google accounts via GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE, the token cache at ~/.config/gws/token_cache.json continues serving the previously cached account's access token. The cache is not keyed by account or credential source.
Steps to reproduce
gws auth loginwith account Agws auth export --unmasked 2>/dev/null > account-a.jsongws auth loginwith account Bgws auth export --unmasked 2>/dev/null > account-b.jsonrm ~/.config/gws/token_cache.jsonGOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE=account-a.json gws gmail users getProfile --params '{"userId": "me"}'→ returns account A ✓GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE=account-b.json gws gmail users getProfile --params '{"userId": "me"}'→ still returns account A ✗rm ~/.config/gws/token_cache.json, then retry step 7 → returns account B ✓
Expected behavior
The token cache should be keyed by credential source (e.g., hash of the refresh token), so switching GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE between exported credential files works without manually deleting the cache.
Current workaround
Delete the token cache before switching accounts:
rm -f ~/.config/gws/token_cache.jsonEnvironment
- gws version: installed via Homebrew
- OS: macOS (Apple Silicon, M1)
- Auth method: exported credentials via
gws auth export
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels