Oauth Oidc
by @codenova58
Deep OAuth 2.0 / OpenID Connect workflow—choosing flows for client type, PKCE, tokens and validation, scopes and consent, rotation, and common misconfigurati...
clawhub install oauth-oidc📖 About This Skill
name: oauth-oidc description: Deep OAuth 2.0 / OpenID Connect workflow—choosing flows for client type, PKCE, tokens and validation, scopes and consent, rotation, and common misconfigurations. Use when implementing SSO, social login, or API access on behalf of users.
OAuth 2.0 / OIDC (Deep Workflow)
OAuth solves delegated authorization; OIDC adds identity on top. Most production bugs are wrong flow for client, token validation gaps, and confused redirect URIs.
When to Offer This Workflow
Trigger conditions:
invalid_grant, redirect_uri mismatches, token replayInitial offer:
Use six stages: (1) actors & client type, (2) select flow & PKCE, (3) tokens & validation, (4) scopes & consent UX, (5) session & logout, (6) operational hardening). Confirm IdP (Auth0, Cognito, Keycloak, Google, etc.).
Stage 1: Actors & Client Type
Goal: Classify confidential vs public clients and who holds secrets.
Rules
Exit condition: Architecture diagram: browser, backend, IdP, resource server.
Stage 2: Select Flow & PKCE
Goal: Authorization Code (+ PKCE for public clients); avoid Implicit and ROPC for new apps.
Practices
Exit condition: Sequence diagram for login happy path and error paths.
Stage 3: Tokens & Validation
Goal: Access token for APIs; ID token for identity claims—validate issuer, audience, exp, signature (JWKS rotation).
Practices
expExit condition: Documented validation steps in code or API gateway config.
Stage 4: Scopes & Consent
Goal: Least privilege scopes; incremental auth when possible.
UX
Stage 5: Session & Logout
Goal: RP-initiated logout vs local session clearing—know what breaks SSO across apps.
Practices
Stage 6: Operational Hardening
Goal: Rotate client secrets safely; monitor failed auth rates; alert on abnormal token issuance.
Pitfalls
Final Review Checklist
Tips for Effective Guidance
Handling Deviations
🔒 Constraints
Exit condition: Architecture diagram: browser, backend, IdP, resource server.