organized-ai/plugin-marketplace/gcp-oauth
Claude Code and agent skill by organized-ai/plugin-marketplace
- community
Checking that the SKILL.md file is still in the repository.
GCP OAuth testing and configuration skill for VisionBridge Attribution. Handles Google Cloud Platform OAuth 2.0 setup, Google Ads API credential management, token exchange flows, and end-to-end OAuth testing against live GCP projects. Use when: (1) Setting up or debugging Google Ads OAuth, (2) Configuring GCP Console credentials, (3) Testing OAuth callback flows, (4) Refreshing or rotating tokens, (5) Troubleshooting Google Ads API auth errors, (6) User mentions "GCP", "Google OAuth", "Google Ads auth", "OAuth callback", or "developer token".
Install
npx vskill@latest install organized-ai/plugin-marketplace/gcp-oauthSKILL.md
The same SKILL.md was published earlier as organized-ai/plugin-marketplace/gcp-oauth.
GCP OAuth Skill — VisionBridge Attribution
Architecture
OAuth Flow (server/google-ads.ts)
Key Files
| File | Purpose | |
|---|---|---|
server/google-ads.ts | Core OAuth + API client (auth URL, token exchange, refresh, API calls) | |
server/routes.ts:2034-2135 | Express routes: /api/auth/google-ads, /api/auth/google-ads/callback, /api/google-ads/status, /api/google-ads/sync, /api/google-ads/disconnect | |
server/capi-dispatchers.ts | Google Enhanced Conversions (offline CAPI) | |
server/storage.ts | adPlatformConnections CRUD for token persistence | |
shared/schema.ts | adPlatformConnections table schema |
Environment Variables
GCP Console Setup Checklist
1. Create OAuth Credentials
- Go to GCP Console → APIs & Services → Credentials
- Create OAuth 2.0 Client ID (Web Application)
- Add authorized redirect URIs:
- Local:
http://localhost:5000/api/auth/google-ads/callback - Production:
https://<your-domain>/api/auth/google-ads/callback - Replit:
https://<replit-url>/api/auth/google-ads/callback
2. Enable APIs
- Google Ads API (
googleads.googleapis.com) - Ensure OAuth consent screen is configured (Internal or External)
3. Developer Token
- Google Ads Account → Admin → API Center
- Apply for Basic Access (test accounts work with Test token)
- Levels: Test → Basic → Standard
4. Set Environment Variables
Testing Procedures
Test 1: Verify Configuration
Test 2: OAuth Flow
Test 3: Token Exchange
After consent, Google redirects to callback with ?code=XXX&state=XXX. The callback handler:
- Validates state (CSRF protection via
pendingOAuthStatesmap) - Exchanges code for tokens (
exchangeGoogleCode) - Fetches accessible customer accounts
- Stores connection in
adPlatformConnections
Test 4: Token Refresh
Test 5: API Calls
Common Issues & Fixes
"Google Ads is not configured"
- Missing
GOOGLE_ADS_CLIENT_IDorGOOGLE_ADS_CLIENT_SECRETin env - Fix: Set all 3 env vars and restart server
"Failed to exchange code for token"
- Redirect URI mismatch between GCP Console and server
- Fix:
getRedirectUri()in google-ads.ts must match GCP Console exactly - Check: localhost vs deployed URL, http vs https
"Access Not Configured" / 403
- Google Ads API not enabled in GCP project
- Developer token not approved or wrong level
- Fix: Enable API in GCP Console, verify developer token
"invalid_grant" on refresh
- Refresh token revoked or expired (6 months for test apps)
- Fix: User must re-authorize via OAuth flow
State validation fails
pendingOAuthStatesis in-memory, lost on server restart- Fix: Complete OAuth flow without restarting. For production, persist state to DB.
API Reference (google-ads.ts exports)
| Function | Purpose | |
|---|---|---|
isGoogleAdsConfigured() | Check if env vars are set | |
getGoogleAdsAuthUrl(host?, clientId?) | Generate OAuth consent URL with CSRF state | |
validateGoogleOAuthState(state) | Verify callback state matches pending | |
exchangeGoogleCode(code, host?) | Exchange auth code for access + refresh tokens | |
refreshGoogleToken(refreshToken) | Get new access token from refresh token | |
getGoogleAdsCustomers(accessToken) | List accessible Google Ads accounts | |
fetchGoogleAdSpend(token, customerId, start, end) | Pull campaign spend data | |
searchGoogleAds(token, customerId, query) | Execute GAQL queries | |
updateGoogleAdsCampaign(token, customerId, campaignId, ops) | Mutate campaign settings | |
getGoogleAdsConversionActions(token, customerId) | List conversion actions | |
uploadGoogleOfflineConversions(token, customerId, action, conversions) | Upload Enhanced Conversions |
Workflow: Full OAuth Integration Test
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckinggoogle-oauth-helper/skills/gcp-oauth/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/organized-ai/plugin-marketplace/gcp-oauth)