Authentication and Authorization in ASP.NET Core 6 Web API
https://www.pluralsight.com/courses/asp-dot-net-core-6-web-api-authentication-authorization by Roland Guijt Mod 1: Course Overview Course Overview Mod 2: API Authentication with Keys and Cookies The Starting Situation Key Protection with Middleware a rudimentary way of protecting a webapi; use a middleware to check for api key in header (not recommended by author) to be able to use security headers in swagger, you have to configure it in code. use the OpenApiSecurityRequirement object Key Protection with an Attribute the solution from previous clip can be implemented as an attribute if an attribute requires dependency injection, attribute will need to be used like this: [TypeFilter(typeof(ApiKeyAttribute))] Cookie Authentication Configuring Cookies and Schemes Restricting Access with the Authorize Attribute Accessing User Information Mod 3: Protecting APIs with Tokens OAuth2 and the Identity Provider tokens for APIs are called access token; for front ends, it is called identity to...