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
                    
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="Cidaas.Net.Sdk.Core" Version="1.1.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cidaas.Net.Sdk.Core" Version="1.1.4" />
                    
Directory.Packages.props
<PackageReference Include="Cidaas.Net.Sdk.Core" />
                    
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 Cidaas.Net.Sdk.Core --version 1.1.4
                    
#r "nuget: Cidaas.Net.Sdk.Core, 1.1.4"
                    
#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 Cidaas.Net.Sdk.Core@1.1.4
                    
#: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=Cidaas.Net.Sdk.Core&version=1.1.4
                    
Install as a Cake Addin
#tool nuget:?package=Cidaas.Net.Sdk.Core&version=1.1.4
                    
Install as a Cake Tool

<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

  1. User logs in through Cidaas OIDC.
  2. The obtained token is exchanged with Ahamatic for extended validation.
  3. Combined user data is stored in the ASP.NET Core authentication context.
  4. 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 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. 
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 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
Loading failed