Authentication And Authorization
Implementing Authentication There are numerous built-in features related to authentication. We need to implement authentication independently for the Blazor Server project and the Blazor WebAssembly project since they operate in slightly different ways. Adding Tables To The Database To be able to add authentication, we need to add the necessary tables to our database. This can be done via Entity Framework: In the MyBlog.Data project , we need to add a couple of NuGet packages. Right click on Dependencies and select Manage NuGet Packages. Search for Microsoft.AspNetCore.Identity.EntityFrameworkCore and click Install. Search for Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore and click Install. We also need to add IdentityServer . Search for Microsoft.AspNetCore. ApiAuthorization.IdentityServer and click Install. Open the MyBlogDbContext.cs file . Change the code so that MyBlogDbContext inherits from ApiAuthorizationDbContext and add a new constructor and overridden OnM...