Challenge: Restrict Access to Content

Test yourself by restricting access to content in a Blazor application.

We'll cover the following

Overview

Using the project below, perform the tasks highlighted in the Requirements section.

Requirements

In the project below, we have a Blazor WebAssembly application. The project has all the necessary security configuration applied, including the framework dependencies and necessary Razor components.

If we open the Index.razor file inside the Pages folder, it has some sensitive content that only authenticated users should see. But as it stands now, any user can see this content.

We need to change the application so that this content is only visible to authenticated users. If the user is not authenticated, they should instead see a single paragraph with the text Nothing to see here..

Get hands-on with 1200+ tech skills courses.