(30/30) Everyone learn Blazor together: . NET 6<ErrorBoundary>
Yesterday, we talked about unit testing, but sometimes it may not be possible to fully test due to time constraints.
Yesterday, we talked about unit testing, but sometimes it may not be possible to fully test due to time constraints.
Probably the most boring process of developing a system is to solve bugs, especially the error of trying to value null objects (`Object reference not set to an instance of an object.`). This should be the most common problem that most people encounter when they first step into the programming field. In order to relieve themselves from the boring process of solving bugs, this article introduces 'unit testing'.
It was mentioned before that 'ASP.NET Core Identity' uses 'Claim' based authentication. In fact,'ASP.NET Core Identity' has different types of authorization methods, the simplest are 'login authorization','role authorization', and 'Claim authorization', but all of the above are implemented in one way: 'Policy-based authorization'.
As mentioned earlier,`ASP.NET Core Identity` is a verification based on `Claim`, and `Role` is a `Claim` of type `Role`
Yesterday, the 'CRUD' functions of the role were completed, and then the role was assigned to the user.
First add a `ViewModel` that carries role data, because the next permissions will be judged based on the role
The day before yesterday, I added verified and failed display content to 'Blog.razor'. However, if the system wants to present the same content that failed to verify, it would be a waste of time to write it in every Component. You can use 'App.razor' to help us do unified presentation.
We mentioned earlier that `UserAuthentication()` and `UserAuthorization()`. The difference between the two is that the former is used to verify who the login person is, and the latter determines what the login person can do.
The verification done yesterday was only for the Identity system and was not included in our log
Today's part of implementing authentication