Skip to main content

OAuth 2.0 Flow Visualizer

Understand every OAuth 2.0 grant type through interactive step-by-step flows. See the exact HTTP requests, response payloads, and parameters for Authorization Code, Client Credentials, Device Code, and the deprecated Implicit flow — with PKCE, tokens, and security notes explained.

✓ 4 OAuth 2.0 grant types ✓ Real HTTP request/response examples ✓ PKCE explained step-by-step ✓ Security notes per step

Frequently Asked Questions

What is the difference between OAuth 2.0 and OpenID Connect (OIDC)?▼

OAuth 2.0 is an authorization framework — it answers 'can this app access this resource on behalf of the user?' It deals in access tokens scoped to specific resources. OpenID Connect (OIDC) is an identity layer built on top of OAuth 2.0 — it answers 'who is this user?' by adding an ID token (a JWT) containing the user's profile. When you see a scope like 'openid profile email', the openid scope triggers OIDC and the auth server returns an id_token in addition to the access_token. Use OAuth alone for delegated API access; add OIDC when you need authentication (login) as well.

What is PKCE and do I always need it?▼

PKCE (Proof Key for Code Exchange, RFC 7636) prevents authorization code interception attacks. Before redirecting, the client generates a random code_verifier, hashes it to produce a code_challenge, and sends the challenge to the auth server. When exchanging the code for tokens, the client sends the original code_verifier — the server verifies they match. Without PKCE, a malicious app on the same device could intercept the authorization code from the redirect and exchange it for tokens. PKCE is required for public clients (SPAs, mobile apps) and strongly recommended for confidential clients too. OAuth 2.1 (the upcoming simplified spec) mandates PKCE for all Authorization Code flows.

When should I use Client Credentials vs Authorization Code?▼

Use Client Credentials when there is no human user involved — your backend service, cron job, or microservice needs to call another API. The service authenticates as itself using its client_id and client_secret. Use Authorization Code when a human user is authorizing access — they need to log in and approve the scopes. The key question is: 'Is there a user who needs to consent?' If yes → Authorization Code. If no → Client Credentials.

How should I store access tokens and refresh tokens securely?▼

Access tokens used in SPAs should be stored in memory (JavaScript variable) — not localStorage or sessionStorage, which are vulnerable to XSS. For web apps with a backend, store the refresh token in an HttpOnly, Secure, SameSite=Strict cookie and issue short-lived session cookies to the browser. Never store sensitive tokens in localStorage. In mobile apps, use the platform's secure storage (iOS Keychain, Android Keystore). Refresh tokens must be treated like passwords — rotate them on use (refresh token rotation) and invalidate old ones immediately.

What happens when an access token expires?▼

When an API returns 401 Unauthorized, the client should check if it has a valid refresh token. If it does, it sends a POST /token request with grant_type=refresh_token and the refresh_token value. The auth server validates the refresh token and returns a new access_token (and often a new refresh_token — refresh token rotation). If the refresh token is also expired or revoked (e.g. user logged out, password changed, suspicious activity), the client must send the user back through the authorization flow from the beginning. Always implement token refresh logic before building any OAuth-protected feature.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

OpenAPI Validator API Response Mock Generator API Response Time Tester OpenAPI Schema Validator OAuth2 Flow Visualizer OpenAPI Mock Generator OAuth2 Flow Debugger API Test Case Generator API Request Builder HTTP Security Headers Generator API Mock Server Config Generator HTTP Security Headers Checker API Rate Limit Calculator API Response Formatter & Analyzer HTTP API Tester LLM Cost Calculator OAuth2 Flow Tester AI Prompt Cost Calculator REST API Request Builder Content Security Policy Builder LLM Prompt Cost Calculator API Response Mocker HTTP Header Inspector AI Rate Limit Calculator Prompt Injection Tester GCP Service Account Key Auditor HTTP Headers Analyzer API Key Generator AI Doc Generator — Pro Tool AI System Guardian .htaccess Generator HTTP Methods Reference HTTP Code Snippet Generator HTTP Status Code Reference HTTP Status Code Reference JSON Diff Viewer JSON Diff nginx Config Generator Password Strength Checker Rate Limiter Tester API Changelog Generator HTTP Mock Response Builder HMAC Generator CSP Header Builder Rate Limit Calculator CORS Policy Builder AWS IAM Policy Validator HTTP Cookie Parser SBOM Generator HTTP Status Code Lookup HTTP Status Code Lookup Vue Component Generator HTTP Status Code Reference LLM Context Window Calculator HTTP Header Analyzer LLM Token Counter Dockerfile Linter mTLS Certificate Chain Builder Prompt Token Estimator Mock Service Worker (MSW) API Mocking Guide Pulumi Modern IaC Guide Casdoor Docker Layer Optimizer HTML5 Canvas API Playground Token Context Calculator GraphQL Client Configurator OpenAI Function Calling Generator Token Counter & Cost Estimator AI API Rate Limit Calculator Password Strength Analyzer

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →