Cidaas.Net.Sdk.Core
1.1.4
dotnet add package Cidaas.Net.Sdk.Core --version 1.1.4
NuGet\Install-Package Cidaas.Net.Sdk.Core -Version 1.1.4
<PackageReference Include="Cidaas.Net.Sdk.Core" Version="1.1.4" />
<PackageVersion Include="Cidaas.Net.Sdk.Core" Version="1.1.4" />
<PackageReference Include="Cidaas.Net.Sdk.Core" />
paket add Cidaas.Net.Sdk.Core --version 1.1.4
#r "nuget: Cidaas.Net.Sdk.Core, 1.1.4"
#:package Cidaas.Net.Sdk.Core@1.1.4
#addin nuget:?package=Cidaas.Net.Sdk.Core&version=1.1.4
#tool nuget:?package=Cidaas.Net.Sdk.Core&version=1.1.4
<h1 align="center">๐ Cidaas .NET SDK</h1> <h3 align="center">Hybrid Authentication (OIDC + Ahamatic) for ASP.NET Core</h3>
<p align="center"> Developed by <a href="https://ahastudio.io/" target="_blank">ahaStudio</a> </p>
<p align="center"> <img src="https://img.shields.io/badge/.NET-8.0-blueviolet?logo=dotnet&logoColor=white" /> <img src="https://img.shields.io/badge/NuGet-Cidaas.Net.Sdk.Core-success?logo=nuget" /> <img src="https://img.shields.io/badge/License-MIT-green" /> <img src="https://img.shields.io/badge/Build-Passing-brightgreen?logo=githubactions" /> </p>
๐ Overview
The Cidaas .NET SDK (Cidaas.Net.Sdk.Core) is a NuGet package designed for ASP.NET Core applications that require secure federated authentication using OpenID Connect (OIDC) through Cidaas, complemented by Ahamatic, an extended authorization and validation service.
The goal is to provide a dual authentication architecture with:
- ๐ Unified user authentication across enterprise systems.
- ๐ Automatic token renewal.
- ๐งฑ Seamless integration into the ASP.NET Core pipeline.
- ๐ Centralized session and access policy management.
๐งฉ Key Features
| Feature | Description | Core Components |
|---|---|---|
| ๐ OIDC Authentication (Cidaas) | Full OpenID Connect flow (login, logout, refresh). | CidaasAuthService, CidaasOptions |
| โ๏ธ Ahamatic Integration | Adds permissions, roles, and extended validation. | AhamaticAuthService, AhamaticOptions |
| ๐ช Secure Session Handling | Stores tokens and claims in secure cookies (SameSite, HttpOnly). | AuthenticationProperties |
| โป๏ธ Automatic Token Renewal | Keeps sessions active by refreshing tokens automatically. | StartTokenRenewal() |
| ๐งฑ ASP.NET Core Integration | Easily injects into the authentication pipeline. | AddCidaasAuth(), AddAhamaticAuth() |
| ๐ง Multi-Environment Support | Modular configuration for dev, staging, and production. | appsettings.{Environment}.json |
๐งฑ Architecture
The SDK follows a decoupled dual-authentication pattern, where each provider handles its own responsibilities.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ASP.NET Core โ
โ Middleware / Controllers โ
โโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ CidaasAuthService โ
โ - Login (OIDC) โ
โ - Token Handling โ
โ - Refresh Tokens โ
โโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ AhamaticAuthService โ
โ - Role Validation โ
โ - Custom Claims โ
โ - Token Synchronization โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Both authentication flows work together to create a combined user identity within the ASP.NET Core authentication context.
โ๏ธ Installation
Install the NuGet package:
dotnet add package Cidaas.Net.Sdk.Core --version 1.1.4
Requirements:
- .NET 8.0 or higher
- ASP.NET Core Authentication
- Network access to external APIs
๐ง Configuration (appsettings.json)
{
"Cidaas": {
"ClientId": "your-client-id",
"Issuer": "https://cidaas.example.com",
"RedirectUri": "https://yourapp.com/signin-oidc",
"Scopes": ["openid", "profile", "email"],
"useAhamatic": false | true
},
"Ahamatic": {
"ApiBaseUrl": "https://api.ahamtic.com",
"ApiKey": "your-api-key",
"ModuleName": "YourModule",
"ApplicationCode": "APP123"
}
}
Register in Program.cs
builder.Services.AddCidaasAuth(builder.Configuration.GetSection("Cidaas"));
builder.Services.AddAhamaticAuth(builder.Configuration.GetSection("Ahamatic"));
var app = builder.Build();
app.UseAuthentication();
app.UseAuthorization();
๐ง Project Structure
cidaas_net_sdk/
โโโ Core/
โ โโโ CidaasAuthService.cs
โ โโโ AhamaticAuthService.cs
โ โโโ Models/
โ โ โโโ AhamaticAccountData.cs
โโโ Options/
โ โโโ CidaasOptions.cs
โ โโโ AhamaticOptions.cs
โโโ Extensions/
โ โโโ AuthenticationExtensions.cs
โโโ README.md
๐ Authentication Flow
- User logs in through Cidaas OIDC.
- The obtained token is exchanged with Ahamatic for extended validation.
- Combined user data is stored in the ASP.NET Core authentication context.
- The SDK monitors token expiration and renews it automatically.
๐งช Example Usage
[Authorize]
public class DashboardController : Controller
{
private readonly AhamaticAuthService _ahamtic;
public DashboardController(AhamaticAuthService ahamtic)
{
_ahamtic = ahamtic;
}
public async Task<IActionResult> Index()
{
var userData = await _ahamtic.GetAccountDataAsync();
return View(userData);
}
}
๐งฐ Suggested CI/CD
Integrate with GitHub Actions:
name: Build and Test
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
๐ก๏ธ License
This project is licensed under the MIT License.
See the LICENSE file for details.
<p align="center"> Built with โค๏ธ by <strong>ahaStudio</strong> โข <a href="https://ahastudio.com">ahastudio.com</a> </p>
| 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
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Cidaas.Net.Sdk.Core:
| Package | Downloads |
|---|---|
|
Cidaas.Blazor.UI
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.4 | 169 | 12/30/2025 |
| 1.1.3 | 137 | 12/30/2025 |
| 1.1.2 | 336 | 11/13/2025 |
| 1.1.1 | 330 | 11/13/2025 |
| 1.1.0 | 244 | 10/30/2025 |
| 1.0.24 | 219 | 10/16/2025 |
| 1.0.23 | 221 | 10/16/2025 |
| 1.0.22 | 226 | 10/16/2025 |
| 1.0.21 | 228 | 10/16/2025 |
| 1.0.20 | 236 | 10/16/2025 |
| 1.0.19 | 236 | 10/15/2025 |
| 1.0.18 | 244 | 10/15/2025 |
| 1.0.17 | 225 | 10/15/2025 |
| 1.0.16 | 226 | 10/15/2025 |
| 1.0.15 | 227 | 10/15/2025 |
| 1.0.14 | 228 | 10/15/2025 |
| 1.0.13 | 224 | 10/15/2025 |
| 1.0.12 | 233 | 10/14/2025 |
| 1.0.11 | 221 | 10/14/2025 |
| 1.0.10 | 235 | 10/14/2025 |