参考回答
I would design a secure authentication service using the SALT framework. Scope: B2C web app with millions of users, supporting password-based login, SSO, and MFA. Compliance with GDPR. Assets: User credentials, session tokens, PII. Threats: Credential stuffing, token theft, session hijacking, brute force. Layers: Identity layer using OAuth 2.0 with PKCE, OIDC for authentication, and MFA (TOTP or WebAuthn) for all users. Network layer with TLS 1.3, rate limiting at the API gateway, and a WAF. Data layer with AES-256 encryption for stored credentials, Argon2 for password hashing, and KMS for key management. Monitoring layer with centralized logging, anomaly detection on login patterns, and alerts on failed login thresholds. Tradeoffs: MFA adds friction, mitigated by risk-based authentication (MFA only for high-risk actions or unfamiliar devices). Performance impact of encryption is minimal with hardware acceleration. Cost of KMS is offset by security benefits.