Skip to content

gws auth login succeeds but commands return 401 — account not registered #198

@uniclawassistant

Description

@uniclawassistant

Environment

  • gws 0.5.0
  • macOS 15 (Apple Silicon, M4)
  • Installed via npm install -g @googleworkspace/cli

Steps to Reproduce

  1. gws auth setup — creates GCP project, enables APIs ✅
  2. gws auth login — OAuth flow completes, credentials encrypted ✅
  3. gws auth status — shows token_valid: true, auth_method: oauth2, encrypted_credentials_exists: true
  4. gws drive files list --params '{ "pageSize": 3 }' — returns 401

Observed Behavior

  • gws auth login returns status: success but account: "(unknown)"
  • gws auth list shows { "accounts": [], "count": 0, "default": "" }
  • gws auth export successfully decrypts and outputs valid credentials (refresh_token, client_id, client_secret)
  • gws auth status shows token_valid: true
  • All API commands (drive, gmail, etc.) fail with 401: "No credentials provided"
  • Setting GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE to exported JSON also does not work

Expected Behavior

After successful gws auth login, commands should authenticate using stored credentials.

Additional Notes

  • OAuth consent screen was published (production mode)
  • Client secret was regenerated manually via Cloud Console
  • gws auth login --help starts OAuth flow instead of showing help
  • 43 APIs enabled on the project
  • Credentials file exists at ~/.config/gws/credentials.enc with valid AES-256-GCM encryption

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions