A Beginner's Guide to Authentication and Authorization

Saurabh SinhaSaurabh Sinha
2 min read

When you use any app or website, two security steps silently protect you: Authentication and Authorization.
Although the words sound similar, they serve different purposes in keeping your data secure.


1. Simple Terms with Examples 📝

  • Authentication → Prove who you are.
    Example: Entering your username & password to log into your email.

  • Authorization → Decide what you can do once you’re in.
    Example: After logging in, you can read your emails but not someone else’s account.


2. Professional View 💼

  • Authentication: Verifying a user’s identity with credentials like passwords, biometrics, or tokens.
    Common methods: Passwords, Multi-factor Authentication (MFA), fingerprints, or face recognition.

  • Authorization: Granting permissions to access certain resources or perform specific actions, usually based on roles or privileges.
    Common methods: Role-Based Access Control (RBAC), OAuth 2.0 scopes, access tokens.


3. Authentication vs Authorization — Quick Table ⚖️

AspectAuthenticationAuthorization
PurposeVerify identityGrant permissions
QuestionWho are you?What can you do?
OrderAlways comes firstHappens after authentication
Data UsedPassword, biometrics, OTPRoles, access levels
User Involved?Yes, user enters detailsUsually runs in the background
Token TypeID TokenAccess Token
ExampleLogging in with credentialsAccessing an admin panel after login

4. Flow of Authentication & Authorization 🔄

  1. User Submits Credentials: Username & password entered.

  2. Authentication: System verifies the credentials.

  3. ID Token Issued: Confirms your identity.

  4. Authorization Check: System determines allowed resources/actions.

  5. Access Token Issued: Contains permission details.

  6. Access Granted or Denied: You can proceed or are blocked.

  7. Ongoing Checks: For secure sessions, authorization may be re-verified.


Final Thoughts 💡

  • Authentication answers “Who are you?”

  • Authorization answers “What can you do?”

They work together to secure your data but are not the same thing.


1
Subscribe to my newsletter

Read articles from Saurabh Sinha directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Saurabh Sinha
Saurabh Sinha

Almost 2 Decade working in IT industry. Some of my core strengths Java, Spring Cloud Technology Technical Architecture Technical Team Handling System Design Algorithms Problem Solver High-Quality Deliverables Code Review Automating System Experienced working in different domain: Finance Product E-Commerce Service based industry Consulting