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 token
- Protecting an API Using Access Tokens
- audience is a microsoft invention, it is not part of OAuth
- Setting up an Identity Provider with Duende IdentityServer
- Scopes and Clients
- Requesting and Sending Access Tokens
- Using a Filter to Fetch and Include Access Tokens
- use case for a ServiceFilter
- Automatic Token Management
- Anatomy of an Access Token
- Reference Tokens
Mod 4: Using Front-ends to Obtain Tokens
- OpenID Connect and the Authorization Code Flow
- Applying Authorization Code Flow
- Accessing and Using the Access Token
- Refresh Tokens and Token Management
- Adding Claims to the Access Token
Mod 5: Adding Authorization
- Checking Audience
- ClaimsPrincipal and Claims Mapping
- Authorization Policies
- Global Policies
- Deciding on an Authorization Strategy
- The Authorization API
- Requirements and Handlers
Comments
Post a Comment