Modern apps are API-first—mobile and SPA clients call JSON endpoints that need the same auth, validation, and rate limits as server-rendered forms.
Checklist
- OAuth2/OIDC or session auth consistently
- Rate limiting and bot protection
- Input schema validation (JSON Schema)
- No sensitive data in URLs (GET tokens)
- CORS configured narrowly—not * in production
Link
Build on Node.js or Django API lessons with security lens.
Important interview questions and answers
- Q: CORS?
A: Browser cross-origin policy—not a substitute for auth. - Q: BOLA?
A: Broken Object Level Authorization on APIs—test object ids.
Self-check
- Why rate limit login?
- CORS misconfiguration risk?
Tip: Integration tests for BOLA on every CRUD route with two test users.
Interview prep
- Rate limiting?
Slows brute force and abuse on APIs.