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
<PackageReference Include="Nova.Sessions.AspNetCore" Version="10.4.0" />
<PackageVersion Include="Nova.Sessions.AspNetCore" Version="10.4.0" />
<PackageReference Include="Nova.Sessions.AspNetCore" />
paket add Nova.Sessions.AspNetCore --version 10.4.0
#r "nuget: Nova.Sessions.AspNetCore, 10.4.0"
#:package Nova.Sessions.AspNetCore@10.4.0
#addin nuget:?package=Nova.Sessions.AspNetCore&version=10.4.0
#tool nuget:?package=Nova.Sessions.AspNetCore&version=10.4.0
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
sidclaim 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
jticlaim 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
Jticolumn through persistence mapping, so no column rename is required.Uses
Nova.Sessions.Model.NovaSessionOptionsas the single options contract for middleware and licensing-client initialization.Validates at startup that
LicensingBaseUrlis an absolute HTTP or HTTPS URL.Removes the duplicate
Nova.Sessions.AspNetCore.Model.NovaSessionOptionstype 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 Unauthorizedresponse when the client must authenticate again.Returns a structured
403 Forbiddenresponse 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 Errorfor known session-configuration failures while logging diagnostic details internally.Returns
503 Service UnavailablewithRetry-Afterfor 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
NovaSessionOptionstype in registration, validation, and runtime services.Uses
IAuditLogfor 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
ClientStateBasevalues inProgram.cswithout 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.Modelto 10.1.0,Nova.Sessions.Modelto 10.1.0,Nova.Sessions.AbstractionsandNova.Sessions.Data.Sqlto 10.3.0, and this package to 10.4.0. - Replace explicit references to
Nova.Sessions.AspNetCore.Model.NovaSessionOptionswithNova.Sessions.Model.NovaSessionOptions; inferredAddNovaSessionslambdas require no code change. - Replace custom
ISessionContextBuilder.Buildimplementations withBuildAsyncand await audit operations. - Configure the required
ClientStateBase.Systemvalue through anAddNovaSessionsclient-state callback. - Update direct construction of
JwtSessionContextBuilderfor 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
sidclaim. Refreshing an access token must retain the samesid; a new login must receive a newsid. - Replace application references to
ClientStateBase.Jti,SessionContext.Jti, andSession.Jtiwith theirSidcounterparts. - At deployment, invalidate or clear active rows created by older versions. Their legacy
Jtivalues are token IDs, not session IDs, and must not count as activesidsessions. - Handle the middleware's structured
401,403, and503responses where applicable. Unexpected exceptions continue to the application's global exception handler.
| Product | Versions 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. |
-
net10.0
- AutoMapper (>= 15.1.3)
- FluentValidation (>= 12.0.0)
- Nova.Abstractions (>= 10.0.2)
- Nova.Abstractions.Security (>= 10.0.2)
- Nova.Licensing.Client (>= 10.0.3)
- Nova.Model (>= 10.1.0)
- Nova.Security (>= 10.0.3)
- Nova.Sessions.Abstractions (>= 10.3.0)
- Nova.Sessions.Data.Sql (>= 10.3.0)
- Nova.Sessions.Model (>= 10.1.0)
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.