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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Cerebellum.AuthBlocks.Data" Version="10.3.39" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cerebellum.AuthBlocks.Data" Version="10.3.39" />
                    
Directory.Packages.props
<PackageReference Include="Cerebellum.AuthBlocks.Data" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Cerebellum.AuthBlocks.Data --version 10.3.39
                    
#r "nuget: Cerebellum.AuthBlocks.Data, 10.3.39"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Cerebellum.AuthBlocks.Data@10.3.39
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Cerebellum.AuthBlocks.Data&version=10.3.39
                    
Install as a Cake Addin
#tool nuget:?package=Cerebellum.AuthBlocks.Data&version=10.3.39
                    
Install as a Cake Tool

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 AddAuthentication boilerplate
  • 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 IHierarchicalRoleService handles 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

AGPL-3.0-or-later

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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