Design a login API which is secure even if SSL certification is compromised.
MediumLet's refine the design of a login API, recognizing that relying solely on SSL for security is insufficient. The problem statement remains the same: design a secure login API. However, this time, we want to explicitly protect against scenarios where the SSL certificate has been compromised (e.g., through a rogue Certificate Authority, man-in-the-middle attack bypassing certificate pinning, or internal key leakage).
The key is to implement additional security measures within the application layer that make it significantly harder for an attacker to succeed even if they can decrypt the traffic. We'll focus on approaches that involve client-side and server-side components working together, such as using asymmetric encryption or token-based authentication with appropriate safeguards. This design should handle the registration and authentication processes. It should be resistant to common attacks such as replay attacks, man-in-the-middle attacks on a compromised SSL connection, and stolen credentials.
Requirements
Interview Simulation
Experience a realistic interview conversation. The interviewer will ask clarifying questions,and you'll reveal your understanding of the requirements.
Let's start by understanding the scope. What are the core functionalities this system needs to provide?
💡 Interview Tip
Identify the Actors (Who uses the system?) and their Use Cases (What are they trying to achieve?). Start with the 'Happy Path' scenarios.