You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

为Duende Identity Server 6添加Redis缓存的方案咨询

Duende IdentityServer 6 中Redis缓存实现方案咨询

我将一个基于Identity Server的项目从IdentityServer4升级到了Duende IdentityServer 6,升级过程看似成功,但不得不移除部分原有代码才能正常运行。

原Startup.cs中的配置如下:

services.AddIdentityServer()
   .AddOperationalStore(options => {
      options.RedisConnectionString = Configuration.GetConnectionString("Redis");
      options.Db = 1;
   })
   .AddRedisCaching(options => {
       options.RedisConnectionString = Configuration.GetConnectionString("Redis");
       options.KeyPrefix = "custom_prefix";
   })
   .AddSigningCredential(new X509Certificate2(Path.Combine(HostingEnvironment.WebRootPath, "secretauth.pfx"), "secret_key"))
   .AddUserStore() // Custom User Store
   .AddResourceStore<CustomResourceStore>()
   .AddClientStore<CustomClientStore>();

旧版本使用的IdentityServer4.Contrib.RedisStore包在IdentityServer 6中已无法使用,导致新实现中无法为会话数据添加Redis缓存,且未找到Duende官方相关的NuGet包。

目前的配置仅为:

services.AddIdentityServer(options => {
    options.LicenseKey = Configuration.GetValue<string>(key: "Duende.IdentityServer:licenseKey");
})
.AddUserStore() // Custom User Store
.AddClientStore<CustomClientStore>()
.AddResourceStore<CustomResourceStore>();

请问是否有可用的NuGet扩展包,还是需要采用全新方式实现操作数据存储的Redis缓存?

内容的提问来源于stack exchange,提问作者Stuart Frankish

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.15 02:35:19