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]
)
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.
Server project:
dotnet add package BitzArt.Blazor.Auth.Server
Client project:
dotnet add package BitzArt.Blazor.Auth.Client
- Add the NuGet package(s) to your Blazor project (see above).
- Configure authentication in your
Program.cs
(see docs). - Use your favorite Blazor auth patterns.
- Enjoy secure, cookie-based authentication without the headaches.
Find guides, API docs, and examples in the documentation.