Yesterday we covered authentication: proving who you are.
But knowing who you are doesn’t mean you’re allowed to do everything.
That’s authorization.
You might be allowed to edit your own profile, but not someone else’s.
A moderator might be able to remove a comment.
An admin might have access to settings regular users never see.
The app already knows who each person is. Authorization determines what each person is allowed to do.
That gives us an easy way to remember the difference:
Authentication: Who are you?
Authorization: What are you allowed to do?
Apps check both because being logged in isn’t the same thing as having permission.
Short version: Authorization determines what a user is allowed to access or change.
Tomorrow: Endpoint — the specific places an app sends requests to.