Sitemap
Chandrakant Pitroda

Chandrakant Pitroda

Salesforce Certified Technical Architect (CTA), passionate trainer, i love exploring nature, trekking, playing with kids.

Authentication vs Authorization

3 min readOct 7, 2020

Identity is one of the most crucial part when it comes to multiple system communication, SSO or integration. We often come to terms like authenticate, authorize which looks almost similar. Many of us are confused between these two words. In this article, I will make sure you get basic differences between two of them.

Let’s take a simple example to understand more. You are living in a house which has bed room, kitchen, hall, balcony and comfort rooms. If some stranger visits your house, what would be the first thing you will ask them? You will ask for the information about that person, if you are not satisfied further you might even ask for identity card or some documents. Once you get satisfactory information, you will allow that person to enter your house. In layman’s terms, this is called authentication.

When two system try to communicate with each other, one system needs to authenticate to other system. This authenticate can happen using different kind of mechanisms, OAuth is the popular mechanism for authentication.

Now lets talk about authorization, lets continue with out house example to understand more. Once you allow a person to enter your house, if a person wants to use your kitchen or comfort room, can person use it without your approval? Answer is no. A person will take your permission before using any of your resources, in layman’s terms this is called authorization. You are authorizing a person to use resources that belongs to you. One thing that we have keep in mind is that if you have authorized person to use your kitchen, a person cannot use your bed room. Similar way authorization is tied to particular resources, you can only access resources that you have been granted access.

Similar way, if System A wants to access any of resources that belongs to System B, authorization is required. System A needs to do authentication first, post successful authentication, System B will provide an authentication code in return to System A. System A needs to use that authentication code and pass it to authorization server, which on success will return the access token. System A can use this access token and access the resource of System B. Each access token is valid for particular kind of resources. You can only access resources that you have been granted access using access token. This is how generic integration works.

Get Chandrakant Pitroda’s stories in your inbox

Join Medium for free to get updates from this writer.

Above flow might be slightly different based on which kind of integration you are doing.

Press enter or click to view image in full size
Authentication vs Authorization

In above example, Data warehouse is trying to access resources from ERP system. In first step, Data warehouse will provide authentication to ERP system. ERP system will authenticate the data ware house system. If authentication is successful, Data warehouse will send a request to access Transaction data. In our scenario, Data warehouse wants to access Transaction data from ERP. When Data warehouse sends request to access data, ERP will return Authentication code and authorization server URL. Data warehouse will hit authorization server URL and pass authentication code. If authorization is successful, access token is returned to Data warehouse which has grant for Transaction data. Using this access token, Data warehouse can only access Transaction data from ERP system.

For each separate resource access, a separate authorization needs to be called.

Authentication comes first, Authorization is second if authentication was successful

References

--

--

Chandrakant Pitroda
Chandrakant Pitroda

Written by Chandrakant Pitroda

Salesforce Certified Technical Architect (CTA), passionate trainer, i love exploring nature, trekking, playing with kids.