Huia.EntityFrameworkCore 1.0.0-alpha.2

This is a prerelease version of Huia.EntityFrameworkCore.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Huia.EntityFrameworkCore --version 1.0.0-alpha.2
                    
NuGet\Install-Package Huia.EntityFrameworkCore -Version 1.0.0-alpha.2
                    
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="Huia.EntityFrameworkCore" Version="1.0.0-alpha.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Huia.EntityFrameworkCore" Version="1.0.0-alpha.2" />
                    
Directory.Packages.props
<PackageReference Include="Huia.EntityFrameworkCore" />
                    
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 Huia.EntityFrameworkCore --version 1.0.0-alpha.2
                    
#r "nuget: Huia.EntityFrameworkCore, 1.0.0-alpha.2"
                    
#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 Huia.EntityFrameworkCore@1.0.0-alpha.2
                    
#: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=Huia.EntityFrameworkCore&version=1.0.0-alpha.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Huia.EntityFrameworkCore&version=1.0.0-alpha.2&prerelease
                    
Install as a Cake Tool

Huia

<div align="center"> <img src="assets/huia-icon.svg" alt="Huia Logo" width="100" /> </div>


<div align="center" style="margin-top: 20px;">

stable

</div>

Huia is an OpenIddict-based identity and authentication library for ASP.NET Core applications. It provides a complete identity solution with built-in UI, OAuth 2.0 / OpenID Connect server capabilities, and flexible key management.

Features

  • 🏗️ OpenIddict Integration - Full OAuth 2.0 / OpenID Connect authorization server
  • 🎨 Built-in Identity UI - Razor Pages for login, register, 2FA, password reset, and more
  • 🔗 External Providers - Sign in with Google, Microsoft, GitHub, or any OAuth2/OIDC provider
  • 🌍 Localization - English and Arabic (RTL) out of the box, easily extensible
  • 🔐 Key Management - Automatic or manual signing/encryption key rotation
  • 📦 EF Core Support - Ready-to-use Entity Framework Core stores
  • 🔧 Extensible - Custom store implementations, events, and email providers
  • 🚀 Multiple Client Flows - SPA, native, server-side web, machine-to-machine, and device authorization

Installation

dotnet add package Huia
dotnet add package Huia.EntityFrameworkCore

Quick Start

1. Configure Services

using Huia;
using Huia.EntityFrameworkCore;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddDbContext<AppDbContext>(options =>
    options.UseSqlite("Data Source=app.db"));

builder.Services.AddHuia("https://localhost:5001", huia =>
{
    huia.Branding.Title = "My App";

    // Register client applications
    huia.Applications.AddSinglePageApplication(app =>
    {
        app.SetClientId("my-spa");
        app.AddRedirectUri("https://localhost:3000/callback");
        app.AddPostLogoutRedirectUri("https://localhost:3000");
        app.AllowScopes("my-api");
    });

    // Enable automatic key management
    huia.KeysManagement.UseAutomaticKeyManagement();
})
.WithEntityFrameworkStores<AppDbContext>();

2. Configure Pipeline

var app = builder.Build();

using (var scope = app.Services.CreateScope())
{
    await scope.ServiceProvider
        .GetRequiredService<AppDbContext>()
        .Database.MigrateAsync();
}

app.UseHuia();
app.UseAuthentication();
app.UseAuthorization();

app.MapHuiaConnectEndpoints();
app.MapHuiaManageEndpoints();
app.MapRazorPages();

app.Run();

public class AppDbContext(DbContextOptions<AppDbContext> options)
    : HuiaDbContext(options);

Documentation

Supported Client Types

Method Client Type Flow Secret Required
AddSinglePageApplication SPA (React/Vue/etc.) Authorization Code + PKCE No
AddNativeApplication Native/Desktop/Mobile Authorization Code + PKCE No
AddServerSideWebApplication Server-rendered web app Authorization Code Yes
AddMachine2Machine Service-to-service Client Credentials Yes
AddDevice Input-constrained devices Device Authorization No

Endpoints

After calling app.UseHuia() and mapping endpoints:

  • /connect/* - OpenIddict OAuth/OIDC endpoints (authorize, token, userinfo, logout, device)
  • /identity/account/* - Identity UI pages (login, register, 2FA, password reset, external sign-in)
  • /api/identity/manage/* - User account management API, including linking/unlinking external providers
  • /identity/admin/api/* - Admin CRUD for applications, scopes, users, roles

Samples

The repository includes complete sample applications:

  • Huia.TodoApi - A Todo CRUD API with Huia authentication
  • Huia.TodoApp - Next.js frontend consuming the API
  • Huia.AdminUI - Administrative interface example

Run the samples with .NET Aspire:

cd samples/Huia.AppHost
dotnet run

Requirements

  • .NET 10.0+
  • ASP.NET Core
  • Entity Framework Core (for Huia.EntityFrameworkCore)

License

Huia is licensed under the MIT License.

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

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 Huia.EntityFrameworkCore:

Package Downloads
Huia.AspNetCore

Huia ASP.NET Core integration: AddHuia() / UseHuia(), Finbuckle base-path multi-tenancy, the OpenIddict server and client, the Razor Pages account UI, passwordless SMS, the signing-key lifecycle jobs and opt-in security headers.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-alpha.4 65 9/6/2026
1.0.0-alpha.3 76 8/17/2026
1.0.0-alpha.2 69 8/13/2026
1.0.0-alpha.1 66 8/11/2026