ProtectKeysWithAzureKeyVault
没有从Azure KeyVault
使用 中拔出钥匙.net 4.7.2.
。但它在.netcore 2.2
我执行以下操作:
public void ConfigureAuth(IAppBuilder app)
{
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = "Identity.Application",
CookieName = ".AspNet.SharedCookie",
LoginPath = new PathString("/Account/Login"),
TicketDataFormat = new AspNetTicketDataFormat(
new DataProtectorShim(
DataProtectionProvider.Create(new DirectoryInfo(@"E:\SBH"), (builder) => {
builder
.ProtectKeysWithAzureKeyVault(
"https://test.vault.azure.net/keys/jwt",
"ClientID",
"ClientScret")
.PersistKeysToFileSystem(new DirectoryInfo(@"E:\SBH"));
}).CreateProtector(
"Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationMiddleware",
"Identity.Application",
"v2"))),
CookieManager = new ChunkingCookieManager()
});
}
代码运行没有任何错误/异常。但没有调用 azure key vault。
问题是什么?
我已经安装了这两个 nuget 包
Microsoft.Owin.Security.Interop
Microsoft.AspNetCore.DataProtection.AzureKeyVault