Securing Blazor Server Views

Learn how to secure individual Blazor Server views.

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": "*"
}
Blazor Server app with the OpenID Connect flow

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 ...