google-auth

Set up OAuth2 credentials for Google APIs including Drive, Sheets, and Chat.

1|Updated Apr 21, 2026
One-click install
npx skills add https://github.com/devbasex/ai-plugins --skill google-auth-devbasex
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: google-auth
Source: https://github.com/devbasex/ai-plugins/tree/main/plugins/ndf/skills/google-auth
Command: npx skills add https://github.com/devbasex/ai-plugins --skill google-auth-devbasex

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires google-auth, google-auth-oauthlib, and includes scripts (resource) components.

What problem does it solve? Google API operations (reading spreadsheets, uploading to Drive, running Apps Script, fetching Chat messages) fail when OAuth tokens are missing, expired, or lack required scopes. This Skill provides a shared authentication module that handles the full OAuth2 flow, token persistence, automatic refresh, and scope merging so other skills and scripts can call Google APIs without re-implementing auth. ## Core Features & Use Cases - Unified token management: Stores all scopes in a single persistent token file at ~/.config/gcloud/google_token.json, automatically merging newly requested scopes with existing ones and re-authenticating only when needed. - Two authentication flows: A local-server flow (default port 9123) for normal environments, and a --manual copy-paste flow that works in containers or environments where ports are unavailable. - Dual CLI and library usage: Run scripts/google_auth.py from the command line for interactive auth, or import get_credentials() from other skills to obtain auto-refreshed credentials programmatically. - Use Case: A spreadsheet-reading skill hits a 403 insufficient-scopes error. Run the auth script with the drive.file and spreadsheets scopes, approve in the browser once, and all subsequent Google API calls across skills reuse the merged token. ## Quick Start Ask the AI to authenticate Google API access with the drive and spreadsheets scopes using the google-auth skill's script, then approve the shown URL in your browser.

Frequently Asked Questions about google-auth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I authenticate Google API access from a Python script?▼

Import get_credentials from the google_auth module and call it with the scopes you need, such as get_credentials(['drive.file']). It returns valid credentials, reusing an existing token, refreshing it if expired, or launching a browser auth flow only when necessary.

How do I fix a 403 insufficient scopes error with Google APIs?▼

Clear the existing token with the --clear flag, then re-authenticate passing all required scopes, for example the drive.file and spreadsheets shorthands. The script merges new scopes with existing ones so previously granted access is preserved.

Can I run Google OAuth authentication inside a Docker container?▼

Yes. Use the --manual flag, which avoids starting a local server entirely. The script prints an authorization URL, and you paste back the redirect URL from the browser address bar, so no open port is required.

Where is the Google OAuth token stored and does it persist?▼

The token is saved to ~/.config/gcloud/google_token.json with 0600 permissions, so it survives container restarts. You can override the location with the GOOGLE_TOKEN_FILE environment variable or the --token-file option.

Why does Google authentication hang when run by an AI agent?▼

The default flow starts a local server and waits for browser interaction, which blocks non-interactive shells. Run the command manually with the interactive prefix, or use the --manual copy-paste flow so the agent never waits on a server callback.