Skip to content

BitzArt/Blazor.Auth

Repository files navigation

Tests

NuGet version NuGet downloads

Overview

Blazor.Auth is a developer-friendly JWT & Cookie authentication library for Blazor. Built for .NET 8+ and designed to make Blazor authentication less painful, more secure, and (dare we say) enjoyable.

🍪 The package uses Blazor.Cookies for persisting user authentication state via browser cookies.

This package is for developers who want to:

  • Add JWT authentication to Blazor apps (Server, WebAssembly, United)
  • Use secure cookie authentication in .NET 8+ Blazor projects
  • Implement authentication & authorization in public-facing Blazor sites, SaaS dashboards, or internal enterprise Blazor apps
  • Implement custom login, logout, and token refresh flows
  • Leverage Blazor's built-in authorization capabilities (such as [AuthorizeView] and [CascadingAuthenticationState])

Why Blazor.Auth?

Because you shouldn't have to fight your framework just to log users in. This library skips the boilerplate, handles Blazor's quirks (SSR, WASM, Server, you name it), and keeps your sanity intact. Built by developers who have already made all the mistakes—so you don't have to.

Install via NuGet

Server project:

dotnet add package BitzArt.Blazor.Auth.Server

Client project:

dotnet add package BitzArt.Blazor.Auth.Client

Quickstart

  1. Add the NuGet package(s) to your Blazor project (see above).
  2. Configure authentication in your Program.cs (see docs).
  3. Use your favorite Blazor auth patterns.
  4. Enjoy secure, cookie-based authentication without the headaches.

Resources

Find guides, API docs, and examples in the documentation.

documentation

License

License