ASP.NET Core Authentication Patterns: Cookie vs JWT vs OIDC
When to use cookie, JWT, or OIDC authentication in ASP.NET Core - a decision framework with threat model considerations.
Insights tagged with Security
When to use cookie, JWT, or OIDC authentication in ASP.NET Core - a decision framework with threat model considerations.
Middleware order determines what works and what silently breaks. ForwardedHeaders before HTTPS, Authentication before Authorization, Routing before Rate Limiting.
Fixed window vs sliding window vs token bucket: choose the right algorithm, partition by IP or user, and handle edge cases like missing IPs and exempt endpoints.
ForwardedHeaders configuration that prevents IP spoofing: KnownNetworks vs KnownProxies, Azure/AWS/Nginx setups, and verification commands.
The 6 configuration mistakes that cause production incidents: secrets in logs, missing validation, hardcoded values, environment leakage, and insecure defaults.
A practical threat model for AI-generated diffs, with concrete guardrails from a real ASP.NET Core content site.