AI Hints
Home›System Design Tutorial›IDs and Security
System Design · Lesson 89 of 120

Security Basics

Authentication and authorization.

⏱ 2 min read▶ Video at 1:47:09🎓 Free
Watch this lesson in the System Design courseWatch on YouTube ↗Full System Design course

Every design needs security, not as an afterthought. Two words come up constantly, and they sound similar. Authentication asks, who are you? Authorization asks, what are you allowed to do?

Security Basics
From the video: Security Basics
  • Security from the start
  • Authentication: who are you?
  • Authorization: what may you do?

Authentication vs authorization

Authentication proves identity, with a password, a code sent to your phone, or a login with Google. Authorization checks permissions, after you're identified. Sam can see Sam's orders, but not Priya's. An admin can change prices, but a customer can't. Both must happen on the server, never just in the app.

Authentication

  • Who are you?Passwords, codes, SSOHappens first

Authorization

  • What may you do?Roles and ownershipChecked on every request

Security checklist

Here's a short checklist for any design. Use HTTPS everywhere. Store passwords only as slow, salted hashes, never in plain text. Give every service the least access it needs. Keep secrets, like API keys, in a secrets manager, not in code. And validate every input, because clients can't be trusted.

HTTPSeverywhere
Passwordssalted, slow hashes
Least privilegeonly what's needed
Secretsin a secrets manager
Validate inputnever trust clients

Summary

Authentication checks who you are, authorization checks what you may do, and both happen on the server. Follow the basic checklist in every design. Next, a quiz on architecture and reliability.

Key takeaways
  • AuthN: who
  • AuthZ: what
  • Checklist every time
Next up: Architecture Quiz — test yourself