Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
196 changes: 130 additions & 66 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,118 @@ The first preview release (**v 0.1.0-preview**) is planned within the next week.
[![Discord](https://img.shields.io/discord/1459498792192839774?color=%237289da&label=Discord&logo=discord&logoColor=%237289da&style=flat-square)](https://discord.gg/QscA86dXSR)
[![codecov](https://codecov.io/gh/CodeBeamOrg/UltimateAuth/branch/dev/graph/badge.svg)](https://codecov.io/gh/CodeBeamOrg/UltimateAuth)

---

## 📑 Table of Contents

- [🗺 Roadmap](#-roadmap)
- [🌟 Why UltimateAuth](#-why-ultimateauth)
- [🚀 Quick Start](#-quick-start)
- [💡 Usage](#-usage)
- [📘 Documentation](#-documentation)
- [🤝 Contributing](#-contributing)
- [⭐ Acknowledgements](#-acknowledgements)

---

UltimateAuth is an open-source authentication framework that unifies secure session and token based authentication, modern PKCE flows, Blazor/Maui-ready client experiences, and a fully extensible architecture — all with a focus on clarity, lightweight design, and developer happiness.
UltimateAuth is an open-source auth framework with platform-level capabilities that unifies secure session, cookie and token based Auth, modern PKCE flows, Blazor/Maui-ready client experiences - eliminating the complexity of traditional Auth systems while providing a clean, lightweight, extensible and developer-first architecture.

---
## 🗺 Roadmap

| Phase | Version | Scope | Status | Release Date |
| ----------------------- | ------------- | ----------------------------------------- | -------------- | ------------ |
| First Preview | 0.1.0-preview | "Stable" Preview Core | ✅ Completed | Last check |
| First Release* | 0.1.0 | Fully Documented & Quality Tested | 🟡 In Progress | Q2 2026 |
| Product Expansion | 0.2.0 | Full Auth Modes | 🟡 In Progress | Q2 2026 |
| Security Expansion | 0.3.0 | MFA, Reauth, Rate Limiting | 🔜 Planned | Q2 2026 |
| Infrastructure Expansion| 0.4.0 | Redis, Distributed Cache, Password Hasher | 🔜 Planned | Q2 2026 |
| Multi-Tenant Expansion | 0.5.0 | Multi tenant management | 🔜 Planned | Q3 2026 |
| Extensibility Expansion | 0.6.0 | Audit, events, hooks | 🔜 Planned | Q3 2026 |
| Performance Expansion | 0.7.0 | Benchmarks, caching | 🔜 Planned | Q3 2026 |
| Ecosystem Expansion | 0.8.0 | Migration tools | 🔜 Planned | Q4 2026 |
| v1.0 | 1.0.0 | Locked API, align with .NET 11 | 🔜 Planned | Q4 2026 |

*v 0.1.0 already provides a skeleton of multi tenancy, MFA, reauth etc. Expansion releases will enhance these areas.

> The project roadmap is actively maintained as a GitHub issue:

👉 https://github.com/CodeBeamOrg/UltimateAuth/issues/8

We keep it up-to-date with current priorities, planned features, and progress. Feel free to follow, comment, or contribute ideas.

<details>

> UltimateAuth is currently in the final stage of the first preview release (v 0.1.0-preview).

> Core architecture is complete and validated through working samples.

> Ongoing work:
> - Final API surface review
> - Developer experience improvements
> - EF Core integration polishing
> - Documentation refinement
</details>

---

## 🌟 Why UltimateAuth: The Six-Point Principles

### **1) Developer-Centric & User-Friendly**
Clean APIs, predictable behavior, minimal ceremony — designed to make authentication *pleasant* for developers.
### 1) Unified Authentication System

One solution, one mental model — across Blazor Server, WASM, MAUI, and APIs.
UltimateAuth eliminates fragmentation by handling client differences internally and exposing a single, consistent API.

### **2) Security-Driven**
PKCE, hardened session flows, reuse detection, event-driven safeguards, device awareness, and modern best practices.
### 2) Plug & Play Ready

### **3) Extensible & Lightweight by Design**
Every component can be replaced or overridden.
No forced dependencies. No unnecessary weight.
Built-in capabilities designed for real-world scenarios:

### **4) Plug-and-Play Ready**
From setup to production, UltimateAuth prioritizes a frictionless integration journey with sensible defaults.
- Automatic client profile detection (blazor server - WASM - MAUI)
- Selectable authentication modes (Session / Token / Hybrid / SemiHybrid)
- Device-aware sessions
- PKCE flows out of the box
- Unified session + token lifecycle
- Event-driven extensibility

### **5) Blazor & MAUI-Ready for Modern .NET**
Blazor WebApp, Blazor WASM, Blazor Server, and .NET MAUI expose weaknesses in traditional auth systems.
UltimateAuth is engineered from day one to support real-world scenarios across the entire modern .NET UI stack.
No boilerplate. No hidden complexity.

### **6) Unified Framework**
One solution, same codebase across Blazor server, WASM and MAUI. UltimateAuth handles client differences internally and providing consistent and reliable public API.
### 3) Developer-Centric

Clean APIs, predictable behavior, minimal ceremony — designed to make authentication pleasant.

### 4) Security as a First-Class Concern

Modern security built-in by default:

- PKCE support
- Session reuse detection
- Device tracking
- Hardened auth flows
- Safe defaults with extensibility

### 5) Extensible & Lightweight

Start simple, scale infinitely:

- Works out of the box with sensible defaults
- Replace any component when needed
- No forced architecture decisions

### 6) Built for Modern .NET Applications

Designed specifically for real-world .NET environments:

- Blazor Server
- Blazor WASM
- .NET MAUI
- Backend APIs

Traditional auth solutions struggle here — UltimateAuth embraces it.

---

# 🚀 Quick Start
> ⏱ Takes ~2 minutes to get started

### 1) Install packages (Will be available soon)

Expand All @@ -66,7 +146,11 @@ Server registration:
```csharp
builder.Services
.AddUltimateAuthServer()
.AddUltimateAuthEntityFrameworkCore(); // Production
.AddUltimateAuthEntityFrameworkCore(db =>
{
// use with your database provider
db.UseSqlite("Data Source=uauth.db");
});

// OR

Expand Down Expand Up @@ -107,7 +191,36 @@ Place this in `App.razor` or `index.html`
<script src="_content/CodeBeam.UltimateAuth.Client.Blazor/uauth.min.js"></script>
```

### 5) Optional: Blazor Usings
### 5) 🗄️ Database Setup (EF Core)

After configuring UltimateAuth with Entity Framework Core, you need to create and apply database migrations.

5.1) Install EF Core tools (if not installed)
```bash
dotnet tool install --global dotnet-ef
```
5.2) Add migration
```bash
dotnet ef migrations add InitUAuth
```

5.3) Update database
```bash
dotnet ef database update
```
💡 Visual Studio (PMC alternative)

If you are using Visual Studio, you can run these commands in Package Manager Console:
```bash
Add-Migration InitUAuth -Context UAuthDbContext
Update-Database -Context UAuthDbContext
```
⚠️ Notes
- Migrations must be created in your application project, not in the UltimateAuth packages
- You are responsible for managing migrations in production
- Automatic database initialization is not enabled by default

### 6) Optional: Blazor Usings
Add this in `_Imports.razor`
```csharp
@using CodeBeam.UltimateAuth.Client.Blazor
Expand Down Expand Up @@ -181,39 +294,6 @@ UltimateAuth turns Auth into a simple application service — not a separate sys

---


## 📅 Release Timeline (Targeted)

> _Dates reflect targeted milestones and may evolve with community feedback._

### **Q1 2026 — First Release**
- v 0.1.0-preview to v 0.1.0

### **Q2 2026 — Stable Feature Releases**
- v 0.2.0 to v 0.3.0

### **Q3 2026 — General Availability**
- API surface locked
- Production-ready security hardening
- Unified architecture finalized

### **Q4 2026 — v 11.x.x (.NET 11 Alignment Release)**
UltimateAuth adopts .NET platform versioning to align with the broader ecosystem.

---

## 🗺 Roadmap

The project roadmap is actively maintained as a GitHub issue:

👉 https://github.com/CodeBeamOrg/UltimateAuth/issues/8

We keep it up-to-date with current priorities, planned features, and progress.

Feel free to follow, comment, or contribute ideas.

---

## 📘 Documentation

Two documentation experiences will be provided:
Expand All @@ -235,22 +315,6 @@ Discussions are open — your ideas matter.

---

## 🛠 Project Status

UltimateAuth core architecture is implemented and validated through the sample application.

We are currently:

- Polishing developer experience
- Reviewing public APIs
- Preparing EF Core integration packages

Preview release is coming soon.

You can check the samples and try what UltimateAuth offers by downloading repo and running locally.

---

## ⭐ Acknowledgements

UltimateAuth is built with love by CodeBeam and shaped by real-world .NET development —
Expand Down
4 changes: 3 additions & 1 deletion UltimateAuth.slnx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<Solution>
<Folder Name="/Packages/">
<Project Path="nuget/CodeBeam.UltimateAuth.EntityFrameworkCore/CodeBeam.UltimateAuth.EntityFrameworkCoreReference.csproj" Id="764569b4-dd5b-4a18-a332-7307d20ee21a" />
<Project Path="nuget/CodeBeam.UltimateAuth.EntityFrameworkCore/CodeBeam.UltimateAuth.EntityFrameworkCore.Bundle.csproj" Id="764569b4-dd5b-4a18-a332-7307d20ee21a" />
<Project Path="nuget/CodeBeam.UltimateAuth.InMemory/CodeBeam.UltimateAuth.InMemory.Bundle.csproj" />
<Project Path="nuget/CodeBeam.UltimateAuth.Reference.Bundle/CodeBeam.UltimateAuth.Reference.Bundle.csproj" Id="f01dee6a-a60d-40a2-bb6a-9894b03e7122" />
</Folder>
<Folder Name="/Samples/">
<Project Path="samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer.EFCore/CodeBeam.UltimateAuth.Sample.BlazorServer.EFCore.csproj" Id="84201d45-0298-4bf3-9bd4-0567b373f6a0" />
<Project Path="samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer/CodeBeam.UltimateAuth.Sample.BlazorServer.csproj" />
<Project Path="samples/blazor-standalone-wasm/CodeBeam.UltimateAuth.Sample.BlazorStandaloneWasm/CodeBeam.UltimateAuth.Sample.BlazorStandaloneWasm.csproj" Id="27bd3c4d-65a9-4c70-a6c9-4178b1897730" />
<Project Path="samples/CodeBeam.UltimateAuth.Sample.Seed/CodeBeam.UltimateAuth.Sample.Seed.csproj" Id="c79b227b-409e-439d-97df-8979a3dc1a60" />
<Project Path="samples/resource-api/CodeBeam.UltimateAuth.Sample.ResourceApi/CodeBeam.UltimateAuth.Sample.ResourceApi.csproj" Id="3d877c9b-65eb-45be-b259-431b2d386736" />
<Project Path="samples/UAuthHub/CodeBeam.UltimateAuth.Sample.UAuthHub/CodeBeam.UltimateAuth.Sample.UAuthHub.csproj" Id="ae5368ee-10aa-4c75-9653-a7f481849834" />
</Folder>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using CodeBeam.UltimateAuth.Authentication.EntityFrameworkCore;
using CodeBeam.UltimateAuth.Authorization.EntityFrameworkCore;
using CodeBeam.UltimateAuth.Credentials.EntityFrameworkCore;
using CodeBeam.UltimateAuth.Sessions.EntityFrameworkCore;
using CodeBeam.UltimateAuth.Tokens.EntityFrameworkCore;
using CodeBeam.UltimateAuth.Users.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;

namespace CodeBeam.UltimateAuth.EntityFrameworkCore;

public sealed class UAuthDbContext : DbContext
{
public UAuthDbContext(DbContextOptions<UAuthDbContext> options)
: base(options)
{
}

// Users
public DbSet<UserLifecycleProjection> UserLifecycles => Set<UserLifecycleProjection>();
public DbSet<UserProfileProjection> UserProfiles => Set<UserProfileProjection>();
public DbSet<UserIdentifierProjection> UserIdentifiers => Set<UserIdentifierProjection>();

// Credentials
public DbSet<PasswordCredentialProjection> PasswordCredentials => Set<PasswordCredentialProjection>();

// Authorization
public DbSet<RoleProjection> Roles => Set<RoleProjection>();
public DbSet<RolePermissionProjection> UserRoleAssignments => Set<RolePermissionProjection>();
public DbSet<UserRoleProjection> UserPermissions => Set<UserRoleProjection>();

// Sessions
public DbSet<SessionRootProjection> Roots => Set<SessionRootProjection>();
public DbSet<SessionChainProjection> Chains => Set<SessionChainProjection>();
public DbSet<SessionProjection> Sessions => Set<SessionProjection>();

// Tokens
public DbSet<RefreshTokenProjection> RefreshTokens => Set<RefreshTokenProjection>();

// Authentication
public DbSet<AuthenticationSecurityStateProjection> AuthenticationSecurityStates => Set<AuthenticationSecurityStateProjection>();

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);

UAuthSessionsModelBuilder.Configure(modelBuilder);
UAuthTokensModelBuilder.Configure(modelBuilder);
UAuthAuthenticationModelBuilder.Configure(modelBuilder);
UAuthUsersModelBuilder.Configure(modelBuilder);
UAuthCredentialsModelBuilder.Configure(modelBuilder);
UAuthAuthorizationModelBuilder.Configure(modelBuilder);
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
using CodeBeam.UltimateAuth.Authentication.EntityFrameworkCore.Extensions;
using CodeBeam.UltimateAuth.Authentication.EntityFrameworkCore;
using CodeBeam.UltimateAuth.Authentication.EntityFrameworkCore.Extensions;
using CodeBeam.UltimateAuth.Authorization.EntityFrameworkCore;
using CodeBeam.UltimateAuth.Authorization.EntityFrameworkCore.Extensions;
using CodeBeam.UltimateAuth.Credentials.EntityFrameworkCore;
using CodeBeam.UltimateAuth.Credentials.EntityFrameworkCore.Extensions;
using CodeBeam.UltimateAuth.Reference.Bundle;
using CodeBeam.UltimateAuth.Sessions.EntityFrameworkCore;
using CodeBeam.UltimateAuth.Sessions.EntityFrameworkCore.Extensions;
using CodeBeam.UltimateAuth.Tokens.EntityFrameworkCore;
using CodeBeam.UltimateAuth.Tokens.EntityFrameworkCore.Extensions;
using CodeBeam.UltimateAuth.Users.EntityFrameworkCore;
using CodeBeam.UltimateAuth.Users.EntityFrameworkCore.Extensions;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
Expand Down Expand Up @@ -56,14 +62,9 @@ public static class UltimateAuthEntityFrameworkCoreExtensions
/// </remarks>
public static IServiceCollection AddUltimateAuthEntityFrameworkCore(this IServiceCollection services, Action<DbContextOptionsBuilder> configureDb)
{
services
.AddUltimateAuthReferences()
.AddUltimateAuthUsersEntityFrameworkCore(configureDb)
.AddUltimateAuthCredentialsEntityFrameworkCore(configureDb)
.AddUltimateAuthAuthorizationEntityFrameworkCore(configureDb)
.AddUltimateAuthSessionsEntityFrameworkCore(configureDb)
.AddUltimateAuthTokensEntityFrameworkCore(configureDb)
.AddUltimateAuthAuthenticationEntityFrameworkCore(configureDb);
services.AddUltimateAuthReferences();
services.AddDbContext<UAuthDbContext>(configureDb);
services.AddUltimateAuthEfCoreStores();

return services;
}
Expand Down Expand Up @@ -91,13 +92,24 @@ public static IServiceCollection AddUltimateAuthEntityFrameworkCore(this IServic

services
.AddUltimateAuthReferences()
.AddUltimateAuthUsersEntityFrameworkCore(options.Resolve(options.Users))
.AddUltimateAuthCredentialsEntityFrameworkCore(options.Resolve(options.Credentials))
.AddUltimateAuthAuthorizationEntityFrameworkCore(options.Resolve(options.Authorization))
.AddUltimateAuthSessionsEntityFrameworkCore(options.Resolve(options.Sessions))
.AddUltimateAuthTokensEntityFrameworkCore(options.Resolve(options.Tokens))
.AddUltimateAuthAuthenticationEntityFrameworkCore(options.Resolve(options.Authentication));
.AddUltimateAuthUsersEntityFrameworkCore<UAuthUserDbContext>(options.Resolve(options.Users))
.AddUltimateAuthCredentialsEntityFrameworkCore<UAuthCredentialDbContext>(options.Resolve(options.Credentials))
.AddUltimateAuthAuthorizationEntityFrameworkCore<UAuthAuthorizationDbContext>(options.Resolve(options.Authorization))
.AddUltimateAuthSessionsEntityFrameworkCore<UAuthSessionDbContext>(options.Resolve(options.Sessions))
.AddUltimateAuthTokensEntityFrameworkCore<UAuthTokenDbContext>(options.Resolve(options.Tokens))
.AddUltimateAuthAuthenticationEntityFrameworkCore<UAuthAuthenticationDbContext>(options.Resolve(options.Authentication));

return services;
}

public static IServiceCollection AddUltimateAuthEfCoreStores(this IServiceCollection services)
{
return services
.AddUltimateAuthUsersEntityFrameworkCore<UAuthDbContext>()
.AddUltimateAuthSessionsEntityFrameworkCore<UAuthDbContext>()
.AddUltimateAuthTokensEntityFrameworkCore<UAuthDbContext>()
.AddUltimateAuthAuthorizationEntityFrameworkCore<UAuthDbContext>()
.AddUltimateAuthCredentialsEntityFrameworkCore<UAuthDbContext>()
.AddUltimateAuthAuthenticationEntityFrameworkCore<UAuthDbContext>();
}
}
Loading
Loading