Q41: How do OAuth 2.0 and JWT fit into system design?
OAuth 2.0 is an authorization framework for delegated access; it defines flows and token usage, not a token format. JWT is a token format that can carry signed claims. A JWT must be validated for signature, issuer, audience, expiry, and relevant claims. Opaque tokens can instead be checked through introspection or a server-side store. Choose based on revocation needs, trust boundaries, token size, and operational complexity; never treat decoding as validation.
Key Takeaways
- OAuth 2.0 is a framework; JWT is a token format.
- Validate claims and signatures, and plan for revocation and key rotation.