Huia.EntityFrameworkCore
1.0.0-alpha.2
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
<PackageReference Include="Huia.EntityFrameworkCore" Version="1.0.0-alpha.2" />
<PackageVersion Include="Huia.EntityFrameworkCore" Version="1.0.0-alpha.2" />
<PackageReference Include="Huia.EntityFrameworkCore" />
paket add Huia.EntityFrameworkCore --version 1.0.0-alpha.2
#r "nuget: Huia.EntityFrameworkCore, 1.0.0-alpha.2"
#:package Huia.EntityFrameworkCore@1.0.0-alpha.2
#addin nuget:?package=Huia.EntityFrameworkCore&version=1.0.0-alpha.2&prerelease
#tool nuget:?package=Huia.EntityFrameworkCore&version=1.0.0-alpha.2&prerelease
Huia
<div align="center"> <img src="assets/huia-icon.svg" alt="Huia Logo" width="100" /> </div>
<div align="center" style="margin-top: 20px;">
</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
- Getting Started - Installation and setup guide
- Architecture - How Huia works internally
- External Providers - Sign in with Google, Microsoft, GitHub, and more
- Localization - Multi-language support (English/Arabic)
- Key Management - Signing and encryption key rotation
- Custom Stores - Implement your own persistence layer
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 | 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
- Huia (>= 1.0.0-alpha.2)
- Microsoft.AspNetCore.Identity.EntityFrameworkCore (>= 10.0.10)
- Microsoft.EntityFrameworkCore (>= 10.0.10)
- Microsoft.Extensions.Http.Resilience (>= 10.8.0)
- OpenIddict.AspNetCore (>= 7.6.0)
- OpenIddict.EntityFrameworkCore (>= 7.6.0)
- OpenIddict.Quartz (>= 7.6.0)
- Quartz.Extensions.Hosting (>= 3.18.2)
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 |