我使用kubernetes StatefulSet作为gke kubernetes中的hangfire吊舱。除进行复制外,它运行正常。由于防伪令牌验证,我收到此异常:
Microsoft.AspNetCore.Antiforgery.Internal.DefaultAntiforgery [7]反序列化令牌时引发异常。Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException:防伪令牌可以不被解密。 ---> System.Security.Cryptography.CryptographicException:密钥在钥匙圈中找不到{9f4f1619-10ff-4283-a529-eb48a0799815}。
请问有什么解决方法吗?
响应是对持久化数据保护密钥的重做
var redis = ConnectionMultiplexer.Connect("localhost,password=password");
services.AddDataProtection()
.PersistKeysToStackExchangeRedis(redis, "DataProtection-Keys");