Authentication vs Authorization
Pronunciationaw-then-tih-KAY-shun versus aw-thor-ih-ZAY-shun
Definition
Authentication checks who you are (login). Authorization checks what you are allowed to do.
Where you hear it
Security, API design, and interviews.
Examples
Authentication passed, but authorization failed, so the API returned 403.
Check authorization on the server for every action.
Login works, but a regular user who opens the admin page still gets a 403.
Common mistake
Using the two words as if they were the same. Remember: authN = who you are, authZ = what you can do.
Say it at work
- In a meeting or chat
Let us make sure our middleware handles authentication before passing the request to the authorization layer.
- In an email or ticket
Could you please update the pull request to ensure that authorization checks are performed after successful authentication?