Search⌘ K
AI Features

Solution Review: Adding a Restricted Razor Page

Explore how to secure Razor Pages with Single Sign-On by applying authentication and authorization methods in ASP.NET Core. Understand how to enforce default authentication, allow anonymous access to specific folders, and restrict access to individual pages effectively.

We'll cover the following...

Overview

The complete solution is available in the following playground:

{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "AllowedHosts": "*"
}
The complete solution with the authorization rules applied

Solving the challenge

To meet the challenge requirements, all of the changes have been applied inside the Program.cs file in the DemoApp project. We applied the following changes:

    ...