Authentication vs Authorization
Authentication checks who you are, and authorization decides what you may do. Logging in with a password is the first. Being let in to delete a post, or not, is the second. The check of who you are always comes first. An app cannot decide what you may do before it knows who you are.
Authentication
How an app checks who you are, often with a password or a phone.
Authentication is how an app checks who you are. You prove it with something you know, like a password, or something you have, like a phone. Once you pass, the app lets you in as that person. It answers one question: who is this? What you are then allowed to do is a separate step, called authorization.
Authorization
What a user may see and do once logged in. It comes after the login.
Authorization decides what a logged-in user is allowed to do. It comes after logging in, which only checks who you are. An app might let every user read posts but only the author edit one. When the check fails, the server answers 403 Forbidden. It must be checked on the server for every request. Hiding a button is not enough.
In one line
- Authentication
- How an app checks who you are, often with a password or a phone.
- Authorization
- What a user may see and do once logged in. It comes after the login.