Abdulfatai
@abdulfatai
journal
Authentication vs Authorization โ they are NOT the same thing. ๐
6 replies 9 views
Authentication vs Authorization โ they are NOT the same thing. ๐
If youโre learning backend development, you need to understand this difference.
Imagine you want to enter a company.
First, the security guard asks for your ID card.
If the ID proves that you are who you claim to be, you are allowed into the building.
That is Authentication.
๐ Authentication = Who are you?
Now, imagine youโve entered the company.
Youโre an employee, but you canโt just walk into the CEOโs office or access the companyโs private database.
Your role determines what youโre allowed to access.
That is Authorization.
๐ Authorization = What are you allowed to do?
In a web application:
Authentication
Login with email/password
Verify OTP
Verify identity
Create/manage a session or token
Authorization
Admin can delete users
User can view their own orders
Manager can access certain resources
Regular users cannot access admin routes
The easiest way to remember it:
๐ Authentication โ Who are you?
๐ก๏ธ Authorization โ What can you access?
You can be authenticated but not authorized to perform a particular action.
For example, you can successfully log into an admin dashboard as a normal user, but you shouldn't be able to delete another user's account.
Authentication comes first. Authorization decides what happens after.
If you're learning backend development, don't just memorize these terms. Understand how they work together. ๐
View passport