Securing Blazor Server Views
Discover how to secure Blazor Server application views by applying authorization globally and individually to Razor components. Learn to enforce automatic login redirects, use authorization attributes, and conditionally display content based on user access permissions in ASP.NET Core.
We'll cover the following...
This lesson will teach us how to enforce authorization requirements in Blazor Server views. We will do so with the help of the following playground:
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}Note: Because we have to build two ASP.NET Core applications and populate the IdP database with the initial seed data, the build process is expected to take at least a few minutes.
If we launch the playground and wait for the applications to build, we will not be granted automatic access to the home page. Instead, we will be redirected to the login page of the IdP application, where we can register a new ...