DEV Community

Al-Amin Islam
Al-Amin Islam

Posted on

Understanding authentication and authorization in simple words

Suppose you want to enter a restricted area. You can't just enter there, you will definitely need a pass card to enter. Suppose it is an ID card, with this ID card you can enter all parts of that area except some VIP areas. This card has a validity period, which I will discuss later some day. Now the point is that as long as you have this valid ID card, you can access inside, whenever you lose the ID card or the validity period expires, you will be kicked out of that area . This is authentication

Now let's tell you what authorization means. Above I was talking about VIP areas, which you cannot enter even if you have a pass. You will need special permission to enter. This is what authorization is

Now let's see an example in programming:
Suppose you want to enter an admin panel. You will need your credentials to enter there, login with them and create a post on this panel, this is authentication. Now you have created the post but you do not have permission to delete it, this is authorization.

Top comments (0)