gpt4 book ai didi

c# - IdentityServer4:如何添加持久 key 并部署到生产环境中?

转载 作者:太空狗 更新时间:2023-10-30 00:29:52 25 4
gpt4 key购买 nike

快速入门示例代码使用 AddTemporarySigningCredential

The AddTemporarySigningCredential extension creates temporary key material for signing tokens on every start. Again this might be useful to get started, but needs to be replaced by some persistent key material for production scenarios. See the cryptography docs for more information.

是否有关于如何用我自己的持久 key 替换 AddTemporarySigningCredential() 并在生产环境中部署身份服务器的分步指南?

最佳答案

关于如何拥有“永久” key ,您有几种选择。基本上,您需要使用 AddSigningCredential() 扩展方法来执行此操作。您会注意到它有一个 X509Certificate2 参数。在生产中部署它的最裸机方法是将证书存储在证书存储中并从 X509Store 中检索它。但我更推荐使用 Azure Key Vault 或 Amazon Key Management Service 或任何其他类似云产品形式的 secret 存储。不要将证书部署为发布工件的一部分。而是从安全的地方检索您的证书。

关于c# - IdentityServer4:如何添加持久 key 并部署到生产环境中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45992354/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com