Perago.SharedKernel.Authorization 1.0.51

dotnet add package Perago.SharedKernel.Authorization --version 1.0.51
                    
NuGet\Install-Package Perago.SharedKernel.Authorization -Version 1.0.51
                    
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="Perago.SharedKernel.Authorization" Version="1.0.51" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Perago.SharedKernel.Authorization" Version="1.0.51" />
                    
Directory.Packages.props
<PackageReference Include="Perago.SharedKernel.Authorization" />
                    
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 Perago.SharedKernel.Authorization --version 1.0.51
                    
#r "nuget: Perago.SharedKernel.Authorization, 1.0.51"
                    
#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 Perago.SharedKernel.Authorization@1.0.51
                    
#: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=Perago.SharedKernel.Authorization&version=1.0.51
                    
Install as a Cake Addin
#tool nuget:?package=Perago.SharedKernel.Authorization&version=1.0.51
                    
Install as a Cake Tool

Perago.SharedKernel.Authorization

API authentication and HMAC request signing for ASP.NET Core applications. Provides JWT/IdentityServer authentication plus HMAC cryptographic request signing for heightened security.

Installation

dotnet add package Perago.SharedKernel.Authorization

Getting Started

JWT Authentication Setup

// appsettings.json
{
  "AuthApiConfiguration": {
    "Resources": [
      {
        "Key": "BackOffice1",
        "IdentityServerBaseUrl": "http://identity-server:9900/auth",
        "OidcApiName": "my_api"
      }
    ]
  }
}

// Startup.cs
public void ConfigureServices(IServiceCollection services)
{
    services.AddApiAuthentication(Configuration);
}

public void Configure(IApplicationBuilder app)
{
    app.UseApiAuthentication();
    app.UseAuthorization();
}

HMAC Authentication Setup

HMAC adds an extra security layer for POST/PUT/DELETE requests.

// appsettings.json
{
  "HmacAuth": {
    "Enabled": true,
    "SharedSecret": "your-secure-secret-key",
    "AllowedClockSkewSeconds": 60,
    "NonceTtlSeconds": 300,
    "NonceStoreProvider": "Memory",
    "SkipPaths": ["/api/public/health"],
    "SkipPathPrefixes": ["/api/public"]
  }
}

// Startup.cs
public void ConfigureServices(IServiceCollection services)
{
    services.AddHmacAuth(Configuration);
}

public void Configure(IApplicationBuilder app)
{
    app.UseMiddleware<HmacPostRequestMiddleware>();
}

Skip HMAC for Specific Endpoints

[HmacAuthSkip]
[HttpPost("api/public/endpoint")]
public IActionResult PublicEndpoint() => Ok();

HMAC Headers

Header Description
X-Hmac-Timestamp Unix timestamp (seconds) in UTC
X-Hmac-Nonce Unique random value (e.g., UUID)
X-Hmac-Signature Base64-encoded HMAC-SHA256 signature

Dependencies

  • IdentityServer4.AccessTokenValidation (3.0.1)
  • Microsoft.AspNetCore.Mvc.Core (2.2.5)
  • Microsoft.EntityFrameworkCore (3.1.32)
  • Npgsql.EntityFrameworkCore.PostgreSQL (3.1.18)
  • Audit.EntityEF.Core (16.2.1)
  • MassTransit (7.3.0)
  • Microsoft.Extensions.* (3.1.32)
  • Newtonsoft.Json (12.0.3)

Target Frameworks

  • netcoreapp3.1

License

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.51 71 5/31/2026
1.0.50 68 5/31/2026
1.0.49 69 5/30/2026
1.0.48 105 5/23/2026
1.0.47 102 5/19/2026
1.0.46 93 5/19/2026
1.0.45 96 5/18/2026
1.0.44 105 5/9/2026
1.0.43 96 5/9/2026
1.0.42 103 5/8/2026
1.0.41 102 4/30/2026
1.0.40 89 4/30/2026
1.0.39 105 4/29/2026
1.0.38 94 4/25/2026
1.0.37 87 4/25/2026
1.0.36 89 4/25/2026
1.0.35 91 4/25/2026
1.0.34 106 4/24/2026
1.0.33 92 4/24/2026
1.0.32 91 4/24/2026
Loading failed