BlazorWasmAuth.Template 1.0.0

dotnet new install BlazorWasmAuth.Template@1.0.0
                    
This package contains a .NET Template Package you can call from the shell/command line.

Blazor WebAssembly Windows Authentication Template

A .NET template for creating a Blazor WebAssembly application with Windows Authentication support.

Features

  • Blazor WebAssembly client application
  • ASP.NET Core Web API server with Windows authentication
  • Automatic Windows user authentication
  • JWT token support (optional)
  • HTTPS configuration
  • CORS configured for development
  • Shared models project

Installation

Install the template from NuGet:

dotnet new install BlazorWasmAuth.Template

Or install locally:

dotnet new install .

Usage

Create a new project using the template:

dotnet new blazorwasm-winauth -n MyProject

Template Options

  • --ApiBaseAddress - The base address for the API server (default: https://localhost:7267)
  • --ClientHttpsPort - HTTPS port for the client (default: 7230)
  • --ClientHttpPort - HTTP port for the client (default: 5064)
  • --ServerHttpsPort - HTTPS port for the server (default: 7267)
  • --ServerHttpPort - HTTP port for the server (default: 5216)
  • --JwtSecret - JWT secret key (default: auto-generated)

Example

dotnet new blazorwasm-winauth -n MyAuthApp --ServerHttpsPort 8001 --ClientHttpsPort 8002

Running the Application

  1. Start the server:

    cd Server
    dotnet run --launch-profile https
    
  2. Start the client (in another terminal):

    cd Client
    dotnet run --launch-profile https
    
  3. Open browser at: https://localhost:7230

Project Structure

  • Client/ - Blazor WebAssembly application
  • Server/ - ASP.NET Core Web API
  • Shared/ - Shared models and DTOs

Authentication Flow

The application uses Windows authentication from the server process. Users are automatically authenticated without requiring explicit login/logout actions.

Debugging

To debug the Blazor WASM client:

  1. Press Shift+Alt+D in the browser
  2. Follow the instructions to launch with debugging enabled
  3. Press Shift+Alt+D again to attach the debugger

License

MIT

  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 255 1/25/2026