Advertisement

Advertisement

Authentication and Authorization

How to Manage authentication authorization in .net core


Authentication aur Authorization ke beech mein ye basic farq hai:

Authentication (Login Process)

  • Matlab: User ka verify karna ki woh kaun hai.

  • Example: Jab user apne username aur password ka use karke login karta hai.

  • Focus: Identity verify karna.

  • Outcome: Agar credentials sahi hote hain, to user system me access le pata hai.

Authorization (Permission Process)

  • Matlab: User ke permissions check karna ki woh system me kya kar sakta hai aur kya nahi.

  • Example: Ek user admin hai, toh woh user management aur settings ko access kar sakta hai, par ek normal user ko ye permissions nahi milengi.

  • Focus: Access rights define karna.

  • Outcome: User ko sirf unhi resources ya actions ka access milta hai jo uske role ya permissions ke according allowed hain.

Dono processes ek saath kaam karte hain:

  1. Pehle Authentication hota hai (kya user valid hai?).

  2. Uske baad Authorization hota hai (kya user is resource ko access kar sakta hai?).

Example:

  • Agar aap bank ki website par login karte hain (Authentication), toh aapki identity verify hoti hai.

  • Lekin agar aap kisi aur account ka balance dekhna chahte hain, toh aapko mana kiya jayega (Authorization), kyunki aapke paas woh permission nahi hai.

Authentication and Authorization Authentication and Authorization Reviewed by Rikesh on January 01, 2025 Rating: 5

No comments:

Powered by Blogger.