C.W.K.
Stream
Lesson 01 of 06 · published

Authentication vs Authorization — Stop Mixing Them Up

~15 min · authn, authz, vocabulary

Level 0Greenhorn
0 XP0/53 lessons0/14 achievements
0/100 XP to next level100 XP to go0% complete

The two words are pronounced the same way at conferences and conflated in the same sentence in 90% of bug tickets. They are completely different layers and confusing them is how privilege-escalation bugs ship.

TermQuestion it answersFailure mode
Authentication (AuthN)"Who are you?"An unverified caller is treated as you
Authorization (AuthZ)"Are you allowed to do this?"A verified caller does something they shouldn't

What solo devs usually ship

  • AuthN: skipped entirely. "It is just for me." Anyone who reaches the URL is automatically "me."
  • AuthZ: not even a concept. One role: god-mode. Every endpoint trusts whoever called it.

This quest's PIN layer (Track 5) gives you AuthN. The admin endpoints (Track 8) introduce a tiny AuthZ split: only the AuthN'd PIN session can hit /admin/*. That two-tier model is enough for most solo apps.

External links

Exercise

Open one of your apps and grep every route handler for an explicit permission check. If 'auth' shows up only at the login route, you have AuthN without AuthZ. Pick one route that should not be reachable by 'any logged-in user' (e.g., /admin/, /users/{id}/edit) and add a single permission check. That is your first AuthZ.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.