Security Basics
Authentication and authorization.
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 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.
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