JWT Authentication for ASP.Net Core using Web API in C#

In this tutorial i'll show you how to authorize Web API in ASP.NET Core using JWT (Json Web Token). JWT is a means of representing claims to be transferred between two parties. The claims in a JWT are encoded as a JSON object that is digitally signed using JSON Web Signature (JWS) and/or encrypted using JSON Web Encryption

To play demo we will create a new asp.net core web application, then select Web API project template and change Authentication to Individual accounts in the Web API project template

To config JWT in ASP.NET Core, we will add a config to the appsetting.json file as below