Nova.Sessions.AspNetCore 10.4.0

dotnet add package Nova.Sessions.AspNetCore --version 10.4.0
                    
NuGet\Install-Package Nova.Sessions.AspNetCore -Version 10.4.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.4.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.4.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.4.0
                    
#r "nuget: Nova.Sessions.AspNetCore, 10.4.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.4.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.4.0
                    
Install as a Cake Addin
#tool nuget:?package=Nova.Sessions.AspNetCore&version=10.4.0
                    
Install as a Cake Tool

Nova.Sessions.AspNetCore

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

Version 10.4.0

This is a breaking middleware release. Upgrade together to Nova.Model 10.1.0, Nova.Sessions.Model 10.1.0, Nova.Sessions.Abstractions 10.3.0, and Nova.Sessions.Data.Sql 10.3.0.

  • Uses the standard OpenID Connect sid claim as the stable session key across access-token refreshes.

  • Requires refreshed access tokens for the same login session to retain the same sid.

  • Stops using the per-token jti claim for session lookup and creation.

  • Allows access-token lifetime to be shorter than session expiration or idle timeout; authentication remains responsible for rejecting expired access tokens before this middleware runs.

  • Keeps the existing SQL Jti column through persistence mapping, so no column rename is required.

  • 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 to 10.4.0

  • Upgrade Nova.Model to 10.1.0, Nova.Sessions.Model to 10.1.0, Nova.Sessions.Abstractions and Nova.Sessions.Data.Sql to 10.3.0, and this package to 10.4.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 non-empty sid claim. Refreshing an access token must retain the same sid; a new login must receive a new sid.
  • Replace application references to ClientStateBase.Jti, SessionContext.Jti, and Session.Jti with their Sid counterparts.
  • At deployment, invalidate or clear active rows created by older versions. Their legacy Jti values are token IDs, not session IDs, and must not count as active sid sessions.
  • 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.4.0 0 10/21/2026
10.3.0 85 10/11/2026
10.2.1 100 10/11/2026
10.2.0 90 10/9/2026
10.1.4 109 9/28/2026
10.1.3 109 9/23/2026
10.1.2 107 9/23/2026
10.1.1 107 9/22/2026
10.1.0 106 9/22/2026
10.0.4 108 9/22/2026
10.0.3 117 9/13/2026
10.0.2 110 9/13/2026
2.0.3 157 7/14/2026
2.0.2 144 7/5/2026
2.0.1 132 7/5/2026
2.0.0 136 7/5/2026

10.4.0: Breaking session-identity update. Uses the standard sid claim as the stable session key across refreshed JWTs, retains the existing SQL Jti column, and removes access-token lifetime coupling to session expiration and idle timeouts.