Protecting a minimal API
A good starting point to understand what JWTs are and how they are used is available at https://jwt.io/introduction.
To enable authentication and authorization based on JWT, the first thing to do is to add the
Microsoft.AspNetCore.Authentication.JwtBearer NuGet package to our project, using one of the following ways:
- Option 1: If you’re using Visual Studio 2022, right-click on the project and choose the Manage NuGet Packages command to open Package Manager GUI, then search for