Skip to main content

Use Existing gcloud Auth

Already logged in with gcloud? The desktop app picks it up automatically.


How It Works

If you've already run gcloud auth application-default login, the desktop app detects your Application Default Credentials (ADC) and uses them to connect to BigQuery. No additional sign-in needed.

This is useful for:

  • Developers who already use gcloud CLI daily
  • Service accounts managed by your organization
  • CI/CD environments where OAuth isn't practical

Setup

Option 1: You Already Have ADC

If you've previously run gcloud auth application-default login, the desktop app detects it on launch. No extra steps needed.

Option 2: Set Up ADC Now

# Install gcloud CLI (if not installed)
brew install google-cloud-sdk

# Log in with application-default credentials
gcloud auth application-default login

This opens a browser window for Google consent. Once approved, credentials are saved to ~/.config/gcloud/application_default_credentials.json.


ADC vs OAuth Sign-In

ADC (gcloud)OAuth (Sign in with Google)
Best forDevelopers with gcloud already set upEveryone else
Setupgcloud auth application-default loginClick "Sign in with Google"
Token storage~/.config/gcloud/macOS Keychain
Project selectionUses gcloud's active projectSelect in Querylab.io
Token refreshManaged by gcloudManaged by Querylab.io

Both methods work equally well. The app tries ADC first, then falls back to OAuth.


Switching Projects

When using ADC, the default project comes from your gcloud config:

# Check current project
gcloud config get-value project

# Switch project
gcloud config set project my-other-project

You can also switch projects inside Querylab.io regardless of which auth method you use.


Troubleshooting

ADC Not Detected

# Verify ADC exists
cat ~/.config/gcloud/application_default_credentials.json

If the file doesn't exist, run gcloud auth application-default login again.

Expired Credentials

# Re-authenticate
gcloud auth application-default login

Wrong Project

# Set the correct project
gcloud config set project your-project-id

Then restart Querylab.io Desktop.