.NET 7 Blazor Web Assembly Role – Base Authorization using ASP.NET Core Identity



.NET 7 Blazor Web Assembly Role – Base Authorization using ASP.NET Core Identity

.NET 7 Blazor Web Assembly Role - Base Authorization using ASP.NET Core Identity

Table of Contents:
00:00 | Introduction to Blazor Role-Base Authorization.
04:06 | Setting up connection string.
04:33 | Creating Application Db Context.
05:00 | Creating Controllers.
06:25 | Creating Custom Authentication State provider.
07:35 | Creating Authentication Service.
10:00 | Registering Identity Role services.
10:47 | Seeding Identity Roles by overriding On Model Creating method.
12:30 | Adding Database Migration to seed the roles in the database.
14:25 | Updating the Custom Authentication State provider to pass token instead on Email.
17:35 | Updating the Login Controller by getting roles and email from the sign -in manager.
18:30 | Updating Authentication Service to receive a token instead on email.
19:40 | Using Authorize View Component to check for user authorization.

Download source code | https://github.com/CodeAcademyCA/Blazor-Web-Assembly-Role-Base-Authorization-Explained
Step-By-Step-Review | https://youtu.be/2PsX0qa18t4 | Configuring Role-based Authorization with Blazor Web Assembly.

Related Videos
https://youtu.be/hAkwyI0creM | Blazor Web Assembly Role – Base Authorization using ASP.NET Core Identity.
https://youtu.be/d34K1Ktu9os | Blazor Web Assembly Authentication using Individual Account.
https://youtu.be/e_mpuTjacr8 | Blazor Server Authentication using Individual Account.
https://youtu.be/d34K1Ktu9os | Blazor Web Assembly Authentication using Individual Account.
https://youtu.be/wvkhwYHMVj4 | Blazor Web Assembly Authentication using Web API and ASP.NET Core Identity
https://youtu.be/U8-2YcjezjY | SQLite Database CRUD Operations in Web API using Entity Framework Core.
https://youtu.be/u1ZtcL6QhJ0 | SQL Server CRUD Operations in Web API using Entity Framework Core.
https://youtu.be/dyIfSbOW3y8 | EFCore Relationships (One-to-One, One-to-Many, Many-to-Many) in Web API with SQL Server.
https://youtu.be/gOPlpY6zRC8 | AutoMapper Data Transfer Objects DTOs explained
https://youtu.be/gQYD68iD04k | Navigation Component in Blazor Web Assembly using NavigationLock
https://youtu.be/Eg679M1ZfT8 | Object Relational Mapper ORM Explained for Everyone
https://youtu.be/qi7pSnujBrs | Scaffold SQL Database with DB First migration in Web API using EntityFrameworkCore.
https://youtu.be/G2QHZPdxN0M | Web API EntityFrameworkCore (EF7) Pagination using Skip() and Take() methods.
https://youtu.be/GWfuDPFxVNk | Send Email in Web API using Mailkit SMTP.
https://youtu.be/7mBTh0tlC-w | AutoMapper Data Transfer Objects DTO with Web API Explained.
https://youtu.be/saPnZhPFqCI | Blazor WebAssembly Chat with SignalR using WebSockets.
https://youtu.be/x2EJ4C_E3w0 | Create JSON Web Token (JWT) for User Registration and Login using Password Hash and Salt.
https://youtu.be/VwI7SMYiLH8 | EFCore All Relationships (11, 1n, nn ) with Entity Framework Core SQL Server.
https://youtu.be/REHetc6M0Lo | Web API Role – Based Authorization with JSON Web Token (JWT).

Introduction
Role-based authorization is a declarative way of limiting resource access that first appeared in ASP.NET (pre-Core). In order for the user to access certain resources, developers must specify a role that the user belongs to. This is done by using the [Authorize] attribute.

Blazor uses the ASP.NET core security model to provide authentication and authorization. Both Blazor server app and client app (WebAssembly) have different security scenarios as Blazor server app uses server resource to provide authorization, and Blazor client app (WebAssembly) runs on the client; hence authorization is only determined which UI option can be accessible by the user.