Skip to content

gws auth login -s chat does not request Chat API OAuth scope #236

@mohamed-benoba

Description

@mohamed-benoba

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:

  1. gws auth login -s drive,gmail,calendar,chat,sheets,docs
  2. Complete browser consent.
  3. Inspect the consent URL’s scope parameter (or the scopes in the exported credentials) — no chat scope is present.
  4. Call Chat API (e.g. via MCP): chat_spaces_list → “insufficient authentication scopes”.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions