Nova.Sessions.AspNetCore 10.3.0

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

Nova.Sessions.AspNetCore

ASP.NET Core middleware and services for activating, validating, and controlling Nova sessions.

Version 10.3.0

This is a breaking middleware release and must be upgraded together with Nova.Sessions.Abstractions and Nova.Sessions.Data.Sql 10.2.0.

  • Uses Nova.Sessions.Model.NovaSessionOptions as the single options contract for middleware and licensing-client initialization.

  • Validates at startup that LicensingBaseUrl is an absolute HTTP or HTTPS URL.

  • Removes the duplicate Nova.Sessions.AspNetCore.Model.NovaSessionOptions type and its temporary mapping adapter.

  • Adds structured validation-start diagnostics for client state and session settings, with password and salt values redacted.

  • Returns a structured 401 Unauthorized response when the client must authenticate again.

  • Returns a structured 403 Forbidden response for expected session-policy rejection.

  • Includes the stable session error code and request trace identifier in error responses.

  • Allows unexpected failures to reach the consuming application's global exception handler.

  • Treats missing, malformed, or inconsistent JWT timing claims as reauthentication failures.

  • Returns a generic structured 500 Internal Server Error for known session-configuration failures while logging diagnostic details internally.

  • Returns 503 Service Unavailable with Retry-After for licensing and distributed-lock availability failures.

  • Corrects the token-versus-session lifetime comparisons.

  • Validates session option ranges and timeout relationships when the application starts.

  • Uses the same NovaSessionOptions type in registration, validation, and runtime services.

  • Uses IAuditLog for session audit events and awaits every audit operation.

  • Preserves an application-provided IAuditLog; the package no-op logger is registered only as a fallback.

  • Removes RayAudit, Graylog, and Serilog package dependencies from the session middleware package.

  • Samples active-session license validation and distinguishes rejected licenses from temporary licensing-service failures.

  • Lets consuming applications initialize application-specific ClientStateBase values in Program.cs without adding a separate middleware.

  • Requires the consuming application to provide ClientStateBase.System; JWT, IP, user-agent, path, and server values are populated by Nova.

Client-state configuration

Configure session options and application-specific client-state values together:

builder.Services.AddNovaSessions(
    options => builder.Configuration
        .GetSection("NovaSessionOptions")
        .Bind(options),
    (context, state) =>
    {
        state.System = "accounting4";
        state.SystemVersion = "1405.1";
        state.Branch = 1;
        state.DbId = "main";
        state.DbName = "ERP";
        state.DbServer = "sql01";
        state.DbServerId = "primary";
    });

For request-dependent values, use the asynchronous overload and resolve scoped services through context.RequestServices. The separate ConfigureNovaClientState() extension remains available for advanced replacement and testing scenarios.

Place the session middleware after forwarded-header and authentication middleware:

app.UseForwardedHeaders();
app.UseAuthentication();
app.UseNovaSessions();
app.UseAuthorization();

No separate UseClientStateSetter() middleware is required.

Migration from 10.1.x

  • Upgrade Nova.Sessions.Abstractions, Nova.Sessions.Data.Sql, and Nova.Sessions.AspNetCore together to 10.2.0.
  • Replace explicit references to Nova.Sessions.AspNetCore.Model.NovaSessionOptions with Nova.Sessions.Model.NovaSessionOptions; inferred AddNovaSessions lambdas require no code change.
  • Replace custom ISessionContextBuilder.Build implementations with BuildAsync and await audit operations.
  • Configure the required ClientStateBase.System value through an AddNovaSessions client-state callback.
  • Update direct construction of JwtSessionContextBuilder for its new dependencies; dependency injection is recommended.
  • Do not rely on the package to register or resolve ISystemResolver; the consuming application now supplies the system value.
  • Ensure issued access tokens contain a jti claim.
  • Handle the middleware's structured 401, 403, and 503 responses where applicable. Unexpected exceptions continue to the application's global exception handler.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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

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
10.3.0 83 10/11/2026
10.2.1 98 10/11/2026
10.2.0 88 10/9/2026
10.1.4 107 9/28/2026
10.1.3 107 9/23/2026
10.1.2 104 9/23/2026
10.1.1 106 9/22/2026
10.1.0 105 9/22/2026
10.0.4 105 9/22/2026
10.0.3 115 9/13/2026
10.0.2 108 9/13/2026
2.0.3 156 7/14/2026
2.0.2 142 7/5/2026
2.0.1 132 7/5/2026
2.0.0 135 7/5/2026

10.3.0: Breaking API update. Uses Nova.Sessions.Model.NovaSessionOptions as the single shared session-options contract for middleware and licensing-client initialization, validates LicensingBaseUrl at startup, and adds structured validation-start diagnostics with sensitive credential fields redacted.