NCache.AspNetCore.Authentication.TicketStore
5.3.800
dotnet add package NCache.AspNetCore.Authentication.TicketStore --version 5.3.800
NuGet\Install-Package NCache.AspNetCore.Authentication.TicketStore -Version 5.3.800
<PackageReference Include="NCache.AspNetCore.Authentication.TicketStore" Version="5.3.800" />
<PackageVersion Include="NCache.AspNetCore.Authentication.TicketStore" Version="5.3.800" />
<PackageReference Include="NCache.AspNetCore.Authentication.TicketStore" />
paket add NCache.AspNetCore.Authentication.TicketStore --version 5.3.800
#r "nuget: NCache.AspNetCore.Authentication.TicketStore, 5.3.800"
#:package NCache.AspNetCore.Authentication.TicketStore@5.3.800
#addin nuget:?package=NCache.AspNetCore.Authentication.TicketStore&version=5.3.800
#tool nuget:?package=NCache.AspNetCore.Authentication.TicketStore&version=5.3.800
NCache.AspNetCore.Authentication.TicketStore
NCache implementation of ASP.NET Core ITicketStore. This package lets you store ASP.NET Core Cookie Authentication tickets in NCache, providing a distributed and highly available backing store that enables authenticated sessions to be shared across multiple application instances while reducing cookie size.
Installation
Install-Package NCache.AspNetCore.Authentication.TicketStore
or, using the .NET CLI:
dotnet add package NCache.AspNetCore.Authentication.TicketStore
Prerequisites
- ASP.NET Core application.
- NCache SDK 5.3.800 or later.
- An NCache 5.3.800 (or later) server should be up and running, with the target cache already created/registered on it.
Getting Started
Setting up NCache
Starting with NCache SDK 5.3.800, the application names only the cache; the server it connects to is read from the application's own configuration file, with one entry per cache name.
appsettings.json:
{
"ncache": {
"YourCacheName": {
"server": "10.0.0.1",
"port": 9800
}
}
}
Replace YourCacheName with the name of your cache and 10.0.0.1 with the IP/hostname of a node hosting it. Multiple servers can be listed as a comma-separated value (for example "10.0.0.1,10.0.0.2").
Note
The
ncachesection is validated strictly: an unknown setting or an invalid port is reported as a configuration error naming the cache and the setting. Use the setting names shown above (server,port, ...), not names such asCacheNameorServerList.
Setting up Package
Register the NCache TicketStore service using either:
- Configuration — bind settings from
appsettings.json. - Programmatic Configuration — configure the options directly in code (see Configuration section below).
- Configuration — bind settings from
Tell cookie authentication to keep its tickets in NCache by setting the injected
ITicketStoreas the cookieSessionStore:
builder.Services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
.AddCookie();
builder.Services.AddOptions<CookieAuthenticationOptions>(CookieAuthenticationDefaults.AuthenticationScheme)
.Configure<ITicketStore>((options, ticketStore) => options.SessionStore = ticketStore);
- Enable authentication in the pipeline:
app.UseAuthentication();
Configuration
Using appsettings.json:
"NCacheTicketStore": {
"CacheName": "defaultCache",
"ServerList": [
{
"Ip": "20.200.20.29",
"Port": 9800
}
]
}
Register the provider:
builder.Services.AddNCacheTicketStore(
builder.Configuration.GetSection("NCacheTicketStore"));
Or configure programmatically:
builder.Services.AddNCacheTicketStore(options =>
{
options.CacheName = "defaultCache";
options.ServerList.Add(new NCacheOptions.ServerConfig
{
Ip = "20.200.20.29",
Port = 9800
});
});
ServerList is optional: when it is omitted, the server for CacheName is read from the ncache configuration section described above.
Adjust the cache name and server list as needed for your environment.
Resources
- NCache Integration Docs
- ITicketStore Overview
- Microsoft ITicketStore Documentation
- Programmer's Guide
Technical Support
Alachisoft provides various technical support resources.
Visit the Alachisoft Support Center to select a support resource appropriate for your issue.
To request additional features or report a documentation discrepancy, contact support@alachisoft.com.
License
Copyright © 2026 Alachisoft. All rights reserved.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. 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. |
-
net6.0
- Alachisoft.NCache.SDK (>= 5.3.800)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.12)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.