RShared.Redis.IdentityKit
10.0.4
dotnet add package RShared.Redis.IdentityKit --version 10.0.4
NuGet\Install-Package RShared.Redis.IdentityKit -Version 10.0.4
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="RShared.Redis.IdentityKit" Version="10.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RShared.Redis.IdentityKit" Version="10.0.4" />
<PackageReference Include="RShared.Redis.IdentityKit" />
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 RShared.Redis.IdentityKit --version 10.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: RShared.Redis.IdentityKit, 10.0.4"
#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 RShared.Redis.IdentityKit@10.0.4
#: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=RShared.Redis.IdentityKit&version=10.0.4
#tool nuget:?package=RShared.Redis.IdentityKit&version=10.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
RShared.Redis.IdentityKit
Мостик между RShared.Redis и RShared.IdentityKit: одноразовые коды и кэш security-штампов в Redis. Мульти-нодный IdentityKit одной строкой: коды общие на все узлы, инвалидация сессий мгновенная и глобальная.
Подключение
builder.AddRedis(o => o.ConnectionString = builder.Configuration.GetConnectionString("redis"))
.AddRedisIdentityKit() // ПОСЛЕ AddRedis, ДО AddAuthKit/AddIdentityKit
.AddAuthKit(builder.Configuration.GetSection("authkit"))
.AddIdentityKit<AppUser>(o => o.CodeHashPepper = builder.Configuration["authkit:pepper"]!);
Как работает
RedisOneTimeCodeStore— реализация шваIOneTimeCodeStore: в Redis лежат только HMAC-SHA256(перец, код)-хэши (otc:{канал}:{purpose}:{назначение}→ хэш,otc-code:{хэш}→ назначение); повторная выдача тройки гасит предыдущий код; потребление атомарно под локом тройки — писатели кодов все наши, лок их сериализует. Промах лока = код невалиден (безопасное направление).RedisSecurityStampCache— реализация шваISecurityStampCacheповерхIRedisCache: смена/сброс пароля дропает штамп из Redis — все узлы режут сессию сразу, а не в пределах 30-минутного окна на узел.
Регистрации
Обе TryAdd — вызывай до AddAuthKit/AddIdentityKit, тогда их memory/EF-дефолты не встанут:
| регистрация | реализация | что даёт |
|---|---|---|
IOneTimeCodeStore |
RedisOneTimeCodeStore |
одноразовые коды в Redis |
ISecurityStampCache |
RedisSecurityStampCache |
глобальный кэш штампов |
Без AddRedis — ArgumentException (fail-fast). Ключи наследуют KeyPrefix из RedisOption.
| 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- RShared.IdentityKit (>= 10.0.4)
- RShared.Redis (>= 10.0.4)
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.0.4 | 95 | 9/9/2026 |