All posts
Tag

authentication

6 posts

Tutorial

FastAPI Auth: The Security Mental Model You Need First

Authentication and authorization are two different problems that most tutorials conflate. Here is the mental model, threat landscape, and FastAPI security toolkit you need before writing a single line of auth code.

9 min read
Tutorial

FastAPI Auth: API Key Authentication for Machine Clients

API keys are the most misused auth mechanism in production. Here is how to generate, scope, rotate, and rate-limit API keys in FastAPI — with the patterns that separate toy projects from production systems.

9 min read
Tutorial

FastAPI Auth: JWT Tokens — Stateless Authentication

JWTs eliminate session storage but introduce revocation challenges. Here is how to build access tokens, refresh tokens, and token rotation in FastAPI — with the security pitfalls that tutorials never mention.

10 min read
Tutorial

FastAPI Auth: Password Authentication Done Right

Password hashing is not security — it is one layer. Here is how to build registration, login, session management, and brute-force protection in FastAPI without the mistakes that lead to credential breaches.

12 min read
Tutorial

FastAPI Auth: OAuth 2.0 — The Authorization Framework

OAuth 2.0 is not authentication — it is authorization. Here are the four grant types, why PKCE is now mandatory, and how to implement the authorization code flow in FastAPI with working code and sequence diagrams.

9 min read