Plain definition
Definition of OAuth 2.0
An open authorization framework (RFC 6749) that lets a user grant your app scoped, revocable access to their account data on another service without ever sharing their password.
User Consent -> Authorization Code (+ PKCE) -> Server Token Exchange -> Scoped Access TokenWorked example
Consider a made-up task-sync app called SyncCove that copies calendar deadlines into a user's workspace pages. Rather than asking users to paste a raw API key or password, SyncCove implements the OAuth 2.0 Authorization Code flow with PKCE (RFC 7636). When a user clicks 'Connect workspace,' SyncCove redirects their browser to the provider's authorization server with its `client_id`, exact `redirect_uri`, narrow read/write `scope`, a random `state` token, and a hashed PKCE `code_challenge`.
After the user approves access on the provider's consent screen, the browser returns to SyncCove's callback URL with a short-lived authorization `code` and matching `state`. SyncCove's backend verifies `state`, exchanges the `code` plus its `client_secret` and PKCE `code_verifier` directly over HTTPS at the token endpoint, encrypts the returned access and refresh tokens at rest, and begins syncing only the approved pages.
Why it matters when you launch
If your product integrates with Slack, Notion, GitHub, Google, or HubSpot, OAuth 2.0 is the standard handshake that makes users trust your 'Connect' button. RFC 6749 defines four roles (resource owner, client, authorization server, and resource server) so credentials stay with the provider while your app receives scoped, revocable tokens. Keep in mind that OAuth 2.0 handles authorization (what your app may access); when you need user login identity, apps layer OpenID Connect (OIDC) on top.
Security best practices have also tightened since 2012. IETF RFC 9700 (Best Current Practice for OAuth 2.0 Security) deprecates the legacy implicit grant (`response_type=token`) because returning access tokens in browser redirects exposes them to leakage and replay, requires PKCE for public clients, and recommends PKCE for confidential server-side clients as well.
Common mistakes
- Using the deprecated implicit grant or skipping PKCE and `state` validation, exposing your callback route to authorization code injection and CSRF attacks.
- Requesting broad admin or full-account scopes during v1 onboarding, causing users to abandon the consent screen and triggering marketplace review rejections.
- Storing access tokens or refresh tokens in browser `localStorage` or unencrypted database columns where an XSS bug or database leak compromises every connected workspace.
- Forgetting to handle expired access tokens, refresh token rotation, and revoked-grant errors gracefully, leaving integrations silently broken days after launch.
Tools and guides that use it
Free tool
Launch Day ChecklistEverything to check before, during and after launch day, saved in your browser.Free tool
SaaS Privacy Policy & Terms GeneratorGenerate clean, developer-friendly Privacy Policy and Terms of Service agreements for Stripe, Google OAuth, and product launches.Founder guide
How to Launch a Notion Integration (2026)Choose the right installation scope, implement Notion OAuth 2.0 and least-privilege capabilities, clear Marketplace review, and win workspace installs.Founder guide
How to Launch a Slack App (2026)Pass OAuth and scope checks, reach the 10-workspace threshold, get approved for the Slack Marketplace and bring your first teams in.Related glossary terms
Official sources
Pritam Ghosh runs Hauntboard and maintains this glossary.
Published · Updated
Building something real? Launch it in public.
A person reviews every launch on Hauntboard, and every view and visit it sends your site is published on your launch page. Free to submit.