OAuth 2.0 Quick Guide

A practical overview of OAuth 2.0 flows, tokens, and PKCE for modern apps.

Grant Types

Key / CodeDescription
Authorization Code + PKCEBrowser/mobile apps with public clients.
Client CredentialsService-to-service access.
Device CodeInput-limited devices (TV/CLI).
Refresh TokenLong-lived session renewal.

Tokens

Key / CodeDescription
Access TokenShort-lived token used to call APIs.
Refresh TokenUsed to obtain new access tokens.
ID Token (OIDC)User identity claims (OpenID Connect).

PKCE Parameters

Key / CodeDescription
code_verifierRandom secret generated by the client.
code_challengeTransformed verifier sent to auth server.
code_challenge_methodS256 recommended.

Security Tips

Use HTTPS everywhere, validate redirect URIs, rotate refresh tokens, and use PKCE for public clients.

Knowledge is power.