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