Stateless authentication mechanism:
- Self-contained, only the server that created the token can verify it
- Stateless backend
- NO tightly coupled to one backend
- Not require shared session storage (Redis, DB)
- Easy horizontal scaling
- No CSRF risk
- Harder to revoke, need to wait until token expired
Flow
- Client → Login (credentials)
- Auth Server → Validate credentials
- Auth Server → Issue token
- Client → Store token
- Client → Send token with every request
- Resource Server → Validate token (not storing)
- Access granted