skills/oauth-callback-diagnostic/SKILL.md
Diagnose OAuth callback URL mismatches for desktop and web apps authenticating to third-party services. Use when a user reports redirect_uri errors, callback URL mismatches, or OAuth flow failures involving external providers (GitHub, Google, Azure AD, etc.). Triggers on: redirect_uri error, callback URL mismatch, OAuth callback not associated, OAuth redirect failed, authorization callback URL.
npx skillsauth add mdmagnuson-creator/yo-go oauth-callback-diagnosticInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Load this skill when: A user reports OAuth authentication failures involving callback/redirect URL mismatches — for any combination of app type (desktop, web) and OAuth provider (GitHub, Google, Azure AD, Auth0, etc.).
This skill applies when Builder encounters any of these error patterns:
| Error Signal | Provider Example | |---|---| | "redirect_uri is not associated with this application" | GitHub | | "redirect_uri_mismatch" | Google | | "The redirect URI in the request does not match the redirect URIs configured" | Azure AD | | "Invalid redirect_uri" | Auth0, Generic | | "The redirect_uri MUST match the registered callback URL" | Generic OIDC | | User says "OAuth callback not working" or "redirect URL error" | Any |
Read the project's OAuth configuration to determine:
.env.local, Supabase secrets, environment variables)Common configuration sources:
| Source | How to Read |
|---|---|
| .env.local / .env | grep -i "oauth\|client_id\|redirect\|callback" .env.local |
| Supabase secrets | supabase secrets list (digests only — read actual values from .env.local) |
| Edge function / API handler | Search for redirect_uri, callback_url, or OAuth initiation logic |
| project.json | Check integrations, authentication, or oauth sections |
Trace the actual callback URL the app sends in the OAuth authorization request:
Look for:
- redirect_uri parameter in OAuth initiate function
- OAUTH_CALLBACK_URL / REDIRECT_URI environment variable
- Hardcoded callback URLs in auth handlers
- Supabase auth callback configuration
Desktop-specific considerations:
localhost callbacks in production (no web server)myapp://callback) or Supabase edge functions as intermediariesBased on the provider, identify where the callback URL must be registered:
| Provider | Registration Location | API Access | |---|---|---| | GitHub | Settings → Developer settings → OAuth Apps → [app] | ❌ Read-only via API (cannot update callback URL) | | Google | Google Cloud Console → APIs & Services → Credentials | ❌ No API for callback URLs | | Azure AD | Azure Portal → App registrations → [app] → Authentication | ✅ Microsoft Graph API can update | | Auth0 | Auth0 Dashboard → Applications → [app] → Settings | ✅ Auth0 Management API | | Supabase | Supabase Dashboard → Authentication → URL Configuration | ✅ Supabase Management API | | Generic OIDC | Provider-specific admin panel | Varies |
═══════════════════════════════════════════════════════════════════════
OAUTH CALLBACK URL MISMATCH DIAGNOSTIC
═══════════════════════════════════════════════════════════════════════
Provider: {provider_name}
Client ID: {client_id}
📤 CALLBACK URL BEING SENT
───────────────────────────────────────────────────────────────────────
{actual_callback_url}
Source: {source_file}:{line_number}
📋 REGISTERED CALLBACK URL(S)
───────────────────────────────────────────────────────────────────────
{known_registered_url or "Cannot read via API — check provider dashboard"}
🔍 MISMATCH
───────────────────────────────────────────────────────────────────────
The callback URL being sent does not match what's registered
with {provider_name}.
Common causes:
- Environment switched (dev → staging → prod) but OAuth app not updated
- Supabase project URL changed
- Custom domain added but OAuth app still has old URL
- Multiple OAuth apps and wrong client ID is configured
🔧 FIX
───────────────────────────────────────────────────────────────────────
{fix_instructions — see Step 5}
═══════════════════════════════════════════════════════════════════════
If the provider supports API updates (Azure AD, Auth0, Supabase):
[F] Fix automatically via API
[O] Open provider dashboard in browser
[S] Skip — I'll fix this manually later
If user chooses [F]:
If the provider does NOT support API updates (GitHub, Google):
[O] Open {provider_name} settings in browser
[S] Skip — I'll fix this manually later
If user chooses [O]:
Steps to fix in {provider_name}:
1. Find the OAuth App with Client ID: {client_id}
2. Add this callback URL:
{actual_callback_url}
3. Save changes
After updating, type "done" and I'll re-test the OAuth flow.
When the user confirms the fix:
Desktop apps (Electron, Tauri) have unique OAuth challenges:
| Approach | How It Works | Callback URL Pattern |
|---|---|---|
| Custom protocol | App registers myapp:// handler, OAuth redirects to myapp://callback | myapp://callback?code=... |
| Localhost server | App starts temporary HTTP server | http://localhost:{port}/callback |
| Edge function intermediary | OAuth redirects to cloud function, which signals the app | https://project.supabase.co/functions/v1/oauth-callback |
| System browser + deeplink | OAuth completes in browser, deeplink returns to app | OS-specific |
myapp:// protocolRead project.json to determine the current environment:
"environments": {
"staging": {
"desktop": {
"appName": "My App Preview",
"loadsFrom": "..."
}
},
"production": {
"desktop": {
"appName": "My App",
"loadsFrom": "..."
}
}
}
The callback URL often differs per environment:
http://localhost:54321/functions/v1/oauth-callbackhttps://staging-project.supabase.co/functions/v1/oauth-callbackhttps://prod-project.supabase.co/functions/v1/oauth-callbackConfirm the user is testing in the expected environment before diagnosing.
When this diagnostic runs during ad-hoc mode analysis:
Minimum viable diagnostic:
.env.local for client IDredirect_uri or callback_url to find what's being sentdata-ai
Generate verification contracts before delegating tasks to sub-agents, defining how success will be measured. Triggers on: verification contract, delegation contract, task verification, contract-first delegation.
testing
Verify that Vercel environment variables point to the correct Supabase project for each environment to prevent staging/production cross-wiring. Triggers on: vercel supabase check, environment alignment, env var check, supabase environment.
development
Manage codebase and database vectorization for semantic search. Use when initializing, refreshing, or querying the vector index. Triggers on: vectorize init, vectorize refresh, vectorize search, semantic search, vector index, enable vectorization.
testing
Patterns for XCUITest UI tests for native Apple apps (macOS/iOS). Use when writing or reviewing XCUITest tests for Swift apps. Triggers on: XCUITest, xcuitest, native app testing, Apple UI tests, SwiftUI tests, AppKit tests, UIKit tests.