skills/oauth-oidc-implementer/SKILL.md
--- license: Apache-2.0 name: oauth-oidc-implementer version: 1.0.0 category: Security tags: - oauth - oidc - authentication - authorization - jwt - security --- # OAuth/OIDC Implementer Expert in implementing OAuth 2.0 and OpenID Connect (OIDC) authentication flows. Specializes in secure token handling, social login integration, API authorization, and identity provider configuration. ## Decision Points ### Flow Selection Matrix **For Web Applications (with backend):** - If fron
npx skillsauth add curiositech/windags-skills oauth-oidc-implementerInstall 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.
Expert in implementing OAuth 2.0 and OpenID Connect (OIDC) authentication flows. Specializes in secure token handling, social login integration, API authorization, and identity provider configuration.
For Web Applications (with backend):
For API Access:
For Enterprise SSO:
Access Tokens:
Refresh Tokens:
Detection: Error response contains "error": "invalid_grant"
Root Cause: Authorization code expired (>10min) or PKCE verifier mismatch
Fix: Implement proper code exchange timing and verify PKCE generation/storage
Detection: API returns 401 with expired token, no automatic retry Root Cause: Missing token refresh logic or refresh token rotation failure Fix: Implement automatic refresh with race condition handling and fallback to login
Detection: OAuth callback validation fails with state parameter errors Root Cause: State not properly stored/validated or CSRF attack in progress Fix: Verify state generation uses cryptographically secure randomness and server-side validation
Detection: Requesting excessive scopes (scope=* or kitchen-sink permissions)
Root Cause: Over-requesting permissions instead of minimal viable scopes
Fix: Request only needed scopes initially, use incremental authorization for additional permissions
Detection: Infinite redirects between app and identity provider Root Cause: Session state mismatch or malformed logout implementation Fix: Implement proper session cleanup and logout flow with back-channel notification
Scenario: React app implementing "Login with Google" using Authorization Code + PKCE
Step 1: Initialize Flow
// Expert catches: PKCE generation must be cryptographically secure
const codeVerifier = base64URLEncode(crypto.getRandomValues(new Uint8Array(32)));
const codeChallenge = base64URLEncode(await crypto.subtle.digest('SHA-256', new TextEncoder().encode(codeVerifier)));
// Novice misses: State must be stored server-side to prevent tampering
const state = crypto.randomUUID();
sessionStorage.setItem('oauth_state', state);
sessionStorage.setItem('pkce_verifier', codeVerifier);
Step 2: Decision Point Navigation
openid profile email onlyStep 3: Handle Callback
// Expert validates: State MUST match exactly
if (urlState !== sessionStorage.getItem('oauth_state')) {
throw new Error('CSRF protection failed');
}
// Novice misses: Code verifier must be included in token exchange
const tokenRequest = {
grant_type: 'authorization_code',
code: authCode,
code_verifier: sessionStorage.getItem('pkce_verifier'),
client_id: CLIENT_ID,
redirect_uri: REDIRECT_URI
};
Step 4: Token Handling
Implementation checklist for production readiness:
Do NOT use this skill for:
api-security-specialist for static API keysauthentication-specialist for credential handlingenterprise-sso-architect for SAML-specific flowsjwt-specialist for application-specific token generationDelegate to other skills:
tls-certificate-managerdatabase-architectapi-rate-limitersecurity-monitoring-specialisttools
Building resilient distributed systems with circuit breakers, retries with full-jitter exponential backoff, retry budgets (per-request 3-attempt + per-client 10% ratio per Google SRE), deadline propagation, and the cascading-failure math (4 layers × 3 retries = 64x amplification). Grounded in Resilience4j, Microsoft Cloud Patterns, AWS Architecture Blog (Marc Brooker), and Google SRE Book.
testing
Designing HTTP cache headers that work correctly across browsers, CDNs, and shared proxies — `Cache-Control` directives per RFC 9111, `stale-while-revalidate` and `stale-if-error` per RFC 5861, the Vary header for varying responses, and surrogate keys for tag-based purging. Grounded in IETF RFCs and Cloudflare/Fastly docs.
development
Use when designing or fixing a Content Security Policy on a real site, choosing between nonce-based and hash-based CSP, adding strict-dynamic, debugging "Refused to execute inline script" errors, deploying CSP in report-only mode first, configuring report-to / report-uri, or auditing an existing policy for unsafe-inline / unsafe-eval / wildcards. Triggers: "CSP blocks legitimate inline script", strict-dynamic, nonce-{RANDOM}, sha256-{HASH}, object-src none, base-uri none, frame-ancestors, Trusted Types, X-Content-Security-Policy obsolete, report-only vs enforced. NOT for general HTTP security headers (HSTS, COOP/COEP), Trusted Types deep dive, CORS configuration, or building a WAF.
tools
Choosing and operating an HTTP API versioning strategy that doesn't break clients — Stripe's date-based pinned versions, the Deprecation/Sunset header pair (RFC 9745 + RFC 8594), URI vs header vs media-type approaches, and the version-transformer pattern. Grounded in Stripe's published architecture and IETF RFCs.