Token-based authorization in .NET Core 6.0
This blog post describes how to implement token-based authentication and authorization using .NET Core 6.0.
The way this works is that when the user is authenticated, a token containing various claims will be stored in the user’s browser. This cookie will be used in subsequent requests, and the claims can be checked on different endpoints in order to provide authorization.
Now let’s get coding!
Inside Startup.cs, add the following to the ConfigureServices(IServiceCollection services) method: