dotnet-blazor-auth

Implement authentication and authorization in Blazor applications with ASP.NET Core Identity.

71|10|Updated Feb 11, 2026
One-click install
npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-blazor-auth-wshaddix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-blazor-auth
Source: https://github.com/wshaddix/dotnet-skills/tree/main/skills/dotnet-blazor-auth
Command: npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-blazor-auth-wshaddix

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill simplifies the complex process of implementing authentication and authorization in Blazor applications across various hosting models, ensuring secure user access.

Core Features & Use Cases

  • Auth Flow Management: Handles differences in authentication mechanisms (cookies vs. tokens) for InteractiveServer, InteractiveWebAssembly, and Hybrid apps.
  • UI Integration: Demonstrates the use of AuthorizeView for conditional UI rendering and CascadingAuthenticationState for accessing auth state in components.
  • Identity Scaffolding: Guides through setting up ASP.NET Core Identity for user management and integrating external providers like Google or Microsoft.
  • Use Case: You need to add secure login and role-based access control to your Blazor Web App. This Skill provides the patterns and code snippets to implement user registration, login, and restrict access to certain pages or components based on user roles.

Quick Start

Implement authentication and authorization in your Blazor application by following the setup and usage examples provided in this skill.

Frequently Asked Questions about dotnet-blazor-auth

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

FAQPage Schema
How do I implement authentication and authorization in a Blazor Web App?

Implement Blazor authentication by configuring ASP.NET Core security services, using AuthorizeView for conditional UI rendering, and CascadingAuthenticationState to access auth state within components.

What is the best way to manage auth flows across different Blazor hosting models?

Managing auth flows across Blazor hosting models requires handling differences in authentication mechanisms, specifically switching between cookie-based authentication for InteractiveServer and token-based authentication for InteractiveWebAssembly.

How do I integrate external identity providers like Google with Blazor?

Integrate external identity providers in Blazor by configuring OAuth and OIDC protocols alongside ASP.NET Core Identity, enabling secure user management and external login flows within your application.

Can I use AuthorizeView to restrict access to specific Blazor components based on user roles?

AuthorizeView enables role-based access control in Blazor by conditionally rendering UI elements based on the current user's authorization policies and roles, restricting access to specific components.

Does Blazor authentication work the same way for InteractiveServer and InteractiveWebAssembly?

Blazor authentication differs between InteractiveServer and InteractiveWebAssembly models, requiring distinct handling of cookies versus tokens to maintain secure user access across the hosting environments.

Why do I need CascadingAuthenticationState when setting up security in Blazor?

CascadingAuthenticationState is required in Blazor to provide cascading access to the authentication state data, allowing nested components to evaluate user authorization policies and render secure UI elements.