What is OAuth?

OAuth is generally authorization between services.


It works by delegating user authentication to the service that hosts the user account, and authorizing third-party applications to access the user account. OAuth 2 provides authorization flows for web & desktop applications .Also mobile devices to some extent.

Lets describe the same with the help of an diagram.

Now what it describes?

If an 3rd party service like photo printing service wants to access your photos on google drive, you need to approve access.

In the above case, photo prinitng service requests access to google drive on user’s behalf. Google drive forwards the request to it’s authorization server. The authorization server asks the user if he can provide the restricted access. Once the user approves, it replies to the printing service with the access token.

Hope it was clear!!!