BolEnglishLearn · Play · Win
Login

🛂 API & Integration · APIs & Integration

🛂

Authentication vs Authorization

API ConceptCoreModule 5

Authentication asks who you are; authorization asks what you may do.

Logging in does not automatically give permission to everything.

💡 In practice

A manager and employee both authenticate, but only the manager may approve expenses.

🖼️ CONCEPT PICTURE
A picture to help remember Authentication vs Authorization
A manager and employee both authenticate, but only the manager may approve expenses.

💡 Authentication is showing your ID at the door; authorization is which rooms your keycard actually opens once you are inside.

💡 Learn🛠️ Apply🎯 Check

💡 Why it matters

Mixing these two up is a common source of security holes. Proving who you are is not the same as being allowed to do a given action. Keeping them separate lets you check identity once and then enforce fine-grained permissions on every sensitive operation.

🛠️ How to achieve it

1
Authenticate first
Confirm the caller's identity with a trusted credential before anything else.
2
Authorize every sensitive action
Check permissions on each protected operation, not just at login.
3
Default to deny
Grant only what a role needs; everything else should be refused by default.
4
Keep the checks server-side
Never rely on the UI hiding a button; enforce permission on the server.

⚠️ Signs of trouble

  • •Any logged-in user can reach admin-only actions.
  • •Permissions are checked only in the browser.
  • •One role quietly has access to everything.
  • •Identity is confirmed but actions are never permission-checked.
⚠️ Common mistake: Assuming a logged-in user is allowed to do anything. Authenticate to learn who they are, then authorize each sensitive action against their permissions.

🎯 Quick check

Score: 0/3

Three questions to test the idea.

  1. 1. What does authentication establish?

    Answer: Who you are

    Authentication proves identity — who the caller is. What they may do is authorization.

  2. 2. A user is logged in. Can they do everything?

    Answer: No — each sensitive action must still be authorized

    Logging in only proves identity. Authorization still decides, per action, what that identity is allowed to do.

  3. 3. Where must permission checks be enforced?

    Answer: On the server

    Hiding a button in the UI is not security; the server must enforce the permission so no caller can bypass it.

🔑 Key terms

Authentication
Proving who you are.
Authorization
Deciding what you are allowed to do.
Role
A named set of permissions, like manager.
Least privilege
Granting only the access actually needed.

✅ Review checklist

📊 Your progress

0%
Mark this topic learned to track it.
Saved in this browser.
🚀 Got it?
Mark it learned and move to the next topic.
Next topic →