gws auth login -s chat does not request Chat API OAuth scope
When running:
gws auth login -s drive,gmail,calendar,chat,sheets,docs
the OAuth consent URL and the saved credentials do not include any Google Chat API scope.
Observed scopes in the auth URL / saved token:
https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/spreadsheets https://www.googleapis.com/auth/gmail.modify https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/documents https://www.googleapis.com/auth/cloud-platform
Missing: A Chat API scope such as https://www.googleapis.com/auth/chat.messages (or equivalent for listing spaces and sending messages as the user).
Result: Chat MCP tools (e.g. chat_spaces_list, chat_spaces_messages_create) return:
Request had insufficient authentication scopes.
Expected: Passing chat in the service list (-s ...,chat) should cause gws to request the appropriate Chat API scope(s) so that Chat API calls work after login.
Environment: gws CLI (version from gws --version) OAuth consent: Internal (Google Workspace org) Chat API enabled for the project in Cloud Console
Repro:
- gws auth login -s drive,gmail,calendar,chat,sheets,docs
- Complete browser consent.
- Inspect the consent URL’s scope parameter (or the scopes in the exported credentials) — no chat scope is present.
- Call Chat API (e.g. via MCP): chat_spaces_list → “insufficient authentication scopes”.
Access blocked: Authorization Error
Unregistered scope(s) in the request: https://www.googleapis.com/auth/chat.users.spacesettings, https://www.googleapis.com/auth/chat.spaces