DioRed.Aith.AspNetCore
1.0.0-preview.9
dotnet add package DioRed.Aith.AspNetCore --version 1.0.0-preview.9
NuGet\Install-Package DioRed.Aith.AspNetCore -Version 1.0.0-preview.9
<PackageReference Include="DioRed.Aith.AspNetCore" Version="1.0.0-preview.9" />
<PackageVersion Include="DioRed.Aith.AspNetCore" Version="1.0.0-preview.9" />
<PackageReference Include="DioRed.Aith.AspNetCore" />
paket add DioRed.Aith.AspNetCore --version 1.0.0-preview.9
#r "nuget: DioRed.Aith.AspNetCore, 1.0.0-preview.9"
#:package DioRed.Aith.AspNetCore@1.0.0-preview.9
#addin nuget:?package=DioRed.Aith.AspNetCore&version=1.0.0-preview.9&prerelease
#tool nuget:?package=DioRed.Aith.AspNetCore&version=1.0.0-preview.9&prerelease
DioRed.Aith.AspNetCore
DioRed.Aith.AspNetCore provides seamless integration between ASP.NET Core applications and Aith, an OAuth 2.0 authorization server and OpenID Connect provider from DioRED.
It offers:
- Browser login (Authorization Code + PKCE) with cookie-based app sessions
- Automatic UserInfo → Claims mapping
- High-level and advanced configuration models
- Built-in interactive login/logout endpoint helpers
- Support for multiple authentication schemes
- Full extensibility for custom OAuth options
🚀 Installation
dotnet add package DioRed.Aith.AspNetCore
✨ Quick Start
Register Aith authentication in Program.cs:
builder.Services.AddAithAuthentication(o =>
{
o.ClientId = "my-app";
o.ClientSecret = "secret";
});
Add interactive login/logout endpoints:
app.MapAithInteractiveEndpoints();
Protect your pages:
app.MapGet("/profile", (ClaimsPrincipal user) =>
{
return $"Hello, {user.Identity?.Name}";
}).RequireAuthorization();
🔧 Advanced Configuration
If you need full control over cookie scheme names, the authentication pipeline, or the underlying OAuth handler:
builder.Services.AddAithAuthenticationCore(o =>
{
o.CookieScheme = "MyCookies";
o.AithScheme = "MyAith";
o.ConfigureAith = aith =>
{
aith.ClientId = "my-app";
aith.ClientSecret = "secret";
};
o.ConfigureAithOAuth = oauth =>
{
oauth.SignInScheme = "MyCookies";
oauth.Scope.Add("custom-scope");
};
// Optional:
// o.ConfigureCookie = cookie => { ... };
});
📡 UserInfo → Claims Mapping
Aith automatically fetches the UserInfo document and maps its fields to claims:
"name"→ClaimTypes.Name"sub"→ClaimTypes.NameIdentifier"email"→ClaimTypes.Email"preferred_username"→"preferred_username"- All other JSON fields → claims with the same JSON property names
This ensures HttpContext.User.Identity.Name works as expected.
🧩 Interactive Login/Logout Endpoints
Add standardized interactive endpoints:
app.MapAithInteractiveEndpoints();
Customize paths/schemes if needed:
app.MapAithInteractiveEndpoints(
loginPath: "/auth/login",
logoutPath: "/auth/logout",
cookieScheme: "MyCookies",
challengeScheme: "MyAith"
);
📚 Summary
DioRed.Aith.AspNetCore gives you a clean, production-ready, extensible way to plug Aith authentication into any ASP.NET Core application, from minimal APIs to MVC to Razor Pages.
If you need programmatic Aith access using client_credentials, see the companion package:
👉 DioRed.Aith.Client (NuGet)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-preview.9 | 108 | 5/11/2026 |
| 1.0.0-preview.8 | 80 | 5/8/2026 |
| 1.0.0-preview.7 | 79 | 5/8/2026 |
| 1.0.0-preview.6 | 82 | 4/21/2026 |
| 1.0.0-preview.5 | 97 | 12/29/2025 |