Skip to content

403 permission error referencing unknown project ID (not user's project) #291

Closed

Description

@cloakmaster

Description

After successful gws auth setup and gws auth login, all API calls fail with a 403 error referencing a project ID (981725602518) that is not the user's GCP project.

Steps to Reproduce

  1. gws auth setup — created new GCP project inkog-workspace (project number 872135302924)
  2. Enabled Gmail API and Calendar API on the project
  3. gws auth login -s gmail,calendar,drive,docs,sheets,contacts,tasks,chat,forms,presentations — success
  4. gws auth status — shows correct project_id inkog-workspace, token valid, gmail.googleapis.com enabled
  5. gws gmail users messages list --params '{"userId": "me", "maxResults": 3}'

Expected Behavior

Returns list of Gmail messages.

Actual Behavior

{
  "error": {
    "code": 403,
    "message": "Caller does not have required permission to use project 981725602518. Grant the caller the roles/serviceusage.serviceUsageConsumer role...",
    "reason": "forbidden"
  }
}

Project 981725602518 is not the user's project. The user's project is 872135302924 (inkog-workspace). The user is Owner on their project.

Environment

  • gws version: latest (installed via npm March 7, 2026)
  • OS: macOS (Darwin 23.6.0, arm64)
  • Auth method: OAuth 2.0
  • GCP project: inkog-workspace
  • Account: Google Workspace (custom domain)

Analysis

gws auth status shows the correct project_id: "inkog-workspace" and the client_secret.json references the correct project. The 981725602518 project ID appears to be an internal/hardcoded quota project that the CLI is using for API calls instead of the user's own project. Setting GOOGLE_WORKSPACE_PROJECT_ID=inkog-workspace does not resolve the issue.

--dry-run shows the correct API URL is being constructed, so the issue is in the request headers (likely a missing or incorrect X-Goog-User-Project header).

Activity

  1. ssmtc commented on Mar 8, 2026

    @ssmtc
    gcloud auth application-default revoke
    gcloud auth application-default login
    gcloud auth application-default set-quota-project your-project-id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions