Engineering Auth OAuth

OAuth & SSO Integration Prompt

Integrate OAuth/SSO without the footguns — the right flow for your client, state and PKCE, token handling, account linking, and the provider-edge cases that break logins.

Overview

OAuth is easy to wire up and easy to wire up insecurely. This prompt plans the integration: the correct flow for your client type (auth code + PKCE, not implicit), CSRF protection via state, where tokens live, how provider accounts link to local users, and the edge cases that cause real outages — email changes, revoked grants, and the user who signs up with Google then tries a password.

Why This Works

  • Auth code + PKCE vs implicit is the choice most insecure integrations get wrong
  • Verified-email account linking closes a common account-takeover path
  • The provider edge cases are where SSO integrations break in production

Best for

  • Products adding social or enterprise SSO
  • Teams new to OAuth's security details
  • Apps mixing SSO and password accounts

Not for

  • Choosing whether to use SSO at all — use the Authentication Strategy Prompt
  • Reviewing an existing JWT — use the JWT Security Review Prompt

Use cases

  • Adding 'Sign in with Google/GitHub/etc.' safely
  • Planning account linking between SSO and local accounts
  • Avoiding the OAuth flow and token mistakes that cause breaches

Tip: Save time by exploring related resources and tools that integrate with this workflow.

Explore all resources