【发布时间】:2021-10-27 11:31:05
【问题描述】:
我正在尝试运行 ASP.NET Core 3.1 应用程序,该应用程序在开发中运行良好,但在生产环境中,我收到以下错误。
启动应用程序时出错。
InvalidOperationException:未指定密钥类型。Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ConfigureSigningCredentials.LoadKey()
InvalidOperationException:未指定密钥类型。 Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ConfigureSigningCredentials.LoadKey() Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ConfigureSigningCredentials.Configure(ApiAuthorizationOptions 选项) Microsoft.Extensions.Options.OptionsFactory.Create(字符串 姓名) ...
我的appsettings.json 包含
"IdentityServer": {
"Clients": {
"TestProjct": {
"Profile": "IdentityServerSPA"
}
}
},
和appsettings.Development.json 包含
"IdentityServer": {
"Key": {
"Type": "Development"
}
}
我想配置密钥以在生产环境中运行,但我找不到说明配置密钥不同方式的文档。
我发现 an example 显示使用 .pfx 文件和证书存储,但我想查看所有可用的内容。有谁知道我在哪里可以找到这方面的文档?或者可以提供一些其他示例来说明如何配置生产密钥?
【问题讨论】:
标签: c# asp.net-core asp.net-identity asp.net-core-3.1