configure-auth

Automate authentication and authorization setup in Blazor Web Apps with ASP.NET Core Identity.

Updated May 28, 2026
One-click install
npx skills add https://github.com/ojrojas/AgentsInstructions --skill configure-auth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: configure-auth
Source: https://github.com/ojrojas/AgentsInstructions/tree/main/.claude/skills/dotnet-blazor/skills/configure-auth
Command: npx skills add https://github.com/ojrojas/AgentsInstructions --skill configure-auth

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires Microsoft.AspNetCore.Authentication, Microsoft.AspNetCore.Authorization, Microsoft.AspNetCore.Identity, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the setup of authentication and authorization in Blazor Web Apps, addressing common issues with [Authorize] on pages, login/logout Identity pages, and handling auth state after WebAssembly loads.

Core Features & Use Cases

  • Authentication & Authorization Setup: Configure services like AddCascadingAuthenticationState and AddAuthorization.
  • ASP.NET Core Identity Integration: Add Identity services for user management and authentication.
  • Conditional Rendering: Handle different render modes for static SSR and interactive components.
  • Page Protection: Apply [Authorize] attributes and AuthorizeView for conditional UI.
  • Auth State Management: Handle auth state in WebAssembly and Auto modes.
  • Use Case: Ideal for developers looking to quickly implement secure authentication in a Blazor Web App without manual configuration.

Quick Start

Use the configure-auth skill to set up authentication for your Blazor Web App by running the following commands in your project directory:

dotnet add package Microsoft.AspNetCore.Authentication
dotnet add package Microsoft.AspNetCore.Authorization
dotnet add package Microsoft.AspNetCore.Identity

Frequently Asked Questions about configure-auth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up authentication in a Blazor Web App with ASP.NET Core Identity?

Setting up Blazor Web App authentication involves adding Microsoft.AspNetCore.Authentication, Authorization, and Identity packages to configure services, manage users, and handle auth state across render modes.

Why does the [Authorize] attribute not work on my Blazor Web App pages?

The [Authorize] attribute fails on Blazor pages when authentication state services and cascading authentication state are not properly configured. You need to ensure authorization services are added and auth state is handled correctly across static SSR and interactive render modes.

How do I handle auth state serialization when Blazor WebAssembly loads?

Handling auth state when WebAssembly loads requires configuring auth state serialization across static SSR and interactive components, ensuring cascading authentication state services manage transitions between server and client rendering.

Can I use ASP.NET Core Identity with Blazor Web App interactive render modes?

Yes, ASP.NET Core Identity integrates with Blazor interactive render modes by configuring conditional rendering, handling auth state across static SSR and WebAssembly components, and applying AuthorizeView for conditional UI.

What packages do I need to configure authorization and authentication in Blazor?

Configuring Blazor authentication requires Microsoft.AspNetCore.Authentication, Microsoft.AspNetCore.Authorization, and Microsoft.AspNetCore.Identity packages to enable cascading authentication state, authorization services, and user management.