Introduction

This article describes the OAuth2.0 Framework used in the ASP. NET Web API for authorization.

This framework is for checking the authorization and allowing the user limited access to the resource. It is works as security for the resources that are accessed by the user. We use the OAuth2.0 for protecting our ASP. NET Web API.

It provides various methods for accessing the resource on the behalf of the Resource Owner. It gives the services of the end-user that provide the permission of a third party to access the resources without knowing the credentials.

Advantages of OAuth2.0

Disadvantages of OAuth2.0

Some rules for defining the OAuth2.0

How OAuth2.0 works is shown below:
OAuth.jpg
  1. First the client sends the request to the owner and receives permission for accessing the resources but this permission is for limited scope and limited duration.
  2. After getting the permission the client access the token from the Authorization server.
  3. Now the client accesses the resource.
We defined in above the flow of OAuth2.0, but how OAuth works is not exactly like that because it depends on the client type.
There is a general approach used in the ASP.NET Web API, that is: