cli icon indicating copy to clipboard operation
cli copied to clipboard

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

Open mohamed-benoba opened this issue 8 months ago • 1 comments

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”.

mohamed-benoba avatar Mar 06 '26 01:03 mohamed-benoba

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

antwonltechguy avatar Nov 09 '26 21:11 antwonltechguy