OAuth 2.0 and OIDC guides for practitioners
PKCE calculation, redirect_uri registration rules, state and nonce, and token exchange, in practical order.
- PKCE S256: computing code_verifier and code_challenge correctlyThe RFC 7636 character set and length rules, the SHA-256 to Base64URL step, and where each value travels in the authorization and token requests.
- Authorization URL parameters: what to send and whyauthorization_endpoint, client_id, redirect_uri, response_type, scope, state, nonce, prompt and code_challenge, with a complete example URL.
- redirect_uri registration rules and open redirect riskWhy exact matching matters, and how wildcards, subdomains, path traversal and userinfo (@) confusion turn into account takeover.
- state and nonce: stopping CSRF and ID token replayWhere to store and compare state, where nonce is verified in an ID token, length and expiry, and the multi-tab and SPA failure modes.
- Token exchange: request shape and reading error codesRequired parameters for the authorization_code grant, client authentication methods, and how to tell invalid_grant from invalid_client.