linux - 如何在 Linux 上为 IdentityServer4 配置密钥
问题描述
我有一个带有 IdentityServer4 的 asp.net 核心应用程序。在生产中,它需要一个密钥。
在 Windows Server 上,我成功部署了它 - 创建了一个自签名证书并添加LocalMacine/my
为密钥位置。
我怎样才能在 Linux 上做同样的事情?
appsettings.json
Windows 上的配置 -需要 Linux 的语法:
"IdentityServer": {
"Clients": {
"MyDemoApp": {
"Profile": "IdentityServerSPA"
}
},
"Key": {
"Type": "Store",
"StoreName": "My",
"StoreLocation": "LocalMachine",
"Name": "CN=my-demo"
}
},
解决方案
您能否使用 appsettings 文件将您的证书称为 .pfx 文件,例如:
{
"Kestrel": {
"Endpoints": {
"Https": {
"Url": "https://identityservice.local:6001",
"Certificate": {
"Path": "identityservice.local.pfx",
"Password": "changeit"
}
}
}
}
}
或者,当我将 IdentityServer 部署为 Linux 容器时,我将证书存储在 Azure Key Vault 中。
推荐阅读
- python - AttributeError:模块“networkx”没有属性“complete_graph”
- mysql - 数据库 MYSQL Sum 和 Avg 自动化
- spring - FetchType.LAZY OneToOne 不工作休眠
- python - python 2.7 RegEx - 搜索问题
- c - 如何根据 C 中的数据类型显示表达式的结果
- python - Scikit-learn中SGDClassifier中最优学习率的公式
- java - 检查指定半径处是否存在不同的区域
- php - L5.5 使用 SSH 在共享主机上的存储和公共目录之间创建符号链接
- java - 401 Unauthorized 当我尝试远程访问 API 时
- vue.js - 尝试在 Vue 中创建响应式表,但事件调用中没有显示任何内容