Cerebellum.AuthBlocks.Data
10.3.39
dotnet add package Cerebellum.AuthBlocks.Data --version 10.3.39
NuGet\Install-Package Cerebellum.AuthBlocks.Data -Version 10.3.39
<PackageReference Include="Cerebellum.AuthBlocks.Data" Version="10.3.39" />
<PackageVersion Include="Cerebellum.AuthBlocks.Data" Version="10.3.39" />
<PackageReference Include="Cerebellum.AuthBlocks.Data" />
paket add Cerebellum.AuthBlocks.Data --version 10.3.39
#r "nuget: Cerebellum.AuthBlocks.Data, 10.3.39"
#:package Cerebellum.AuthBlocks.Data@10.3.39
#addin nuget:?package=Cerebellum.AuthBlocks.Data&version=10.3.39
#tool nuget:?package=Cerebellum.AuthBlocks.Data&version=10.3.39
Cerebellum.AuthBlocks
A convenience library built on top of ASP.NET Core Identity for .NET 10, designed for rapid authentication and authorization integration within the BlazorBlocks application ecosystem.
Overview
AuthBlocks reduces authentication boilerplate to a single AddAuthBlocks(...) call. It wires together JWT Bearer authentication, ASP.NET Core Identity, hierarchical role authorization, email-based pending-registration flows, and EF Core startup seeding — purpose-built for Cerebellum Softworks' BlazorBlocks-based full-stack applications but usable in any ASP.NET Core Web API host.
Features
- JWT Bearer authentication — full token validation configured via a single options object; no manual
AddAuthenticationboilerplate - ASP.NET Core Identity integration — ships
ApplicationUser,ApplicationRole, and all related entity types ready for EF Core - Hierarchical role authorization — roles inherit permissions from parent roles; a cached
IHierarchicalRoleServicehandles transitive role checks transparently, replacing the default ASP.NET Core role handler - Pending registration flow — token-based invitation system with email delivery via Mailtrap
- Startup seeding — applies EF migrations on boot, seeds system roles, and optionally seeds an admin user on first run
- Pre-built minimal API routes — ready-to-map endpoints for
/auth,/users,/roles,/user-roles, and/pending-registrations
Installation
dotnet add package Cerebellum.AuthBlocks
AuthBlocks targets net10.0 and requires a compatible ASP.NET Core Web API host.
Quick Start
1. Register services
builder.Services.AddAuthBlocks(options =>
{
options.ConnectionString = builder.Configuration.GetConnectionString("Default")!;
options.ApplicationName = "MyApp";
options.SupportEmail = "support@example.com"; // optional — shown in registration emails
options.JwtSettings.Secret = builder.Configuration["Jwt:Secret"]!;
options.JwtSettings.Issuer = builder.Configuration["Jwt:Issuer"]!;
options.JwtSettings.Audience = builder.Configuration["Jwt:Audience"]!;
options.EmailConnection.Host = builder.Configuration["Email:Host"]!;
options.EmailConnection.Token = builder.Configuration["Email:Token"]!;
// Optional: seed an admin user on first boot
options.AdminUserSettings = new AdminUserSettings
{
UserName = "admin",
Email = "admin@example.com",
Password = builder.Configuration["Admin:Password"]!
};
});
2. Run startup tasks
var app = builder.Build();
// Applies pending EF migrations, seeds system roles, and optionally seeds the admin user.
await app.Services.UseAuthBlocksStartupAsync();
3. Map auth routes
app.UseAuthentication();
app.UseAuthorization();
app.MapAuthBlocks(); // registers /auth, /users, /roles, /user-roles, /pending-registrations
Hierarchical Roles
AuthBlocks replaces the default ASP.NET Core role authorization handler with one that understands role inheritance. Roles are arranged in a parent–child tree. A user assigned a higher-privilege parent role (e.g. Admin) automatically satisfies authorization checks that require any of its descendant roles (e.g. Staff, Viewer). Privilege flows downward — granting a parent role implicitly grants access to everything the child roles protect.
Role hierarchy is seeded automatically from SystemRole definitions on startup — no manual database setup required.
Dependencies
| Package | Purpose |
|---|---|
Cerebellum.NetBlocks |
Result types, environment config helpers |
Cerebellum.BlazorBlocks.Models |
Shared model primitives |
Cerebellum.BlazorBlocks.Api |
Shared API contracts for the BlazorBlocks ecosystem |
Microsoft.AspNetCore.Authentication.JwtBearer |
JWT Bearer middleware |
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Cerebellum.AuthBlocks.Models (>= 10.3.39)
- Cerebellum.BlazorBlocks.Data (>= 10.3.35)
- Cerebellum.NetBlocks (>= 10.3.32)
- Microsoft.AspNetCore.Components.Authorization (>= 10.0.7)
- Microsoft.AspNetCore.Identity.EntityFrameworkCore (>= 10.0.7)
- Microsoft.AspNetCore.Identity.UI (>= 10.0.7)
- Microsoft.EntityFrameworkCore (>= 10.0.7)
- Microsoft.Extensions.Identity.Core (>= 10.0.7)
- Microsoft.Extensions.Identity.Stores (>= 10.0.7)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 10.0.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Cerebellum.AuthBlocks.Data:
| Package | Downloads |
|---|---|
|
Cerebellum.AuthBlocks
Convenience library built on top of ASP.NET Core Identity for .NET 10, providing streamlined authentication and authorization for BlazorBlocks-based application ecosystems. Wires up JWT Bearer auth, hierarchical role authorization with inheritance, token-based registration flows with email delivery, EF Core startup seeding, and pre-built minimal-API endpoints — all via a single AddAuthBlocks() call. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.3.39 | 201 | 6/23/2026 |
| 10.3.38 | 144 | 6/21/2026 |
| 10.3.37 | 136 | 6/20/2026 |
| 10.3.36 | 157 | 6/20/2026 |
| 10.3.35 | 144 | 5/29/2026 |
| 10.3.34 | 158 | 5/27/2026 |
| 10.3.33 | 189 | 5/22/2026 |
| 10.3.32 | 143 | 5/19/2026 |
| 10.3.30 | 141 | 5/18/2026 |
| 10.3.17 | 133 | 5/18/2026 |
| 10.3.16 | 146 | 5/17/2026 |
| 10.3.15 | 137 | 5/17/2026 |
| 10.3.3 | 142 | 5/18/2026 |