![](/img/trans.png)
[英]remote certificate is invalid according to the validation procedure (Identity server Hosted in azure)
[英]Using an Identity Server signing certificate in Azure
在IdentityServer示例代碼(startup.cs)中,我們可以看到如何使用證書:
var certFile = env.ApplicationBasePath + "\\idsrv3test.pfx";
var signingCertificate = new X509Certificate2(certFile, "idsrv3test");
如果我將STS部署到Azure作為Web App服務,如何在生產環境中執行此操作?
為了安全起見,我知道我無法將pfx文件添加到解決方案中。
將證書上傳到門戶網站:
現在您可以通過以下方式獲得證
var certStore = new X509Store(StoreName.My, StoreLocation.CurrentUser);
certStore.Open(OpenFlags.ReadOnly);
var certCollection = certStore.Certificates.Find(
X509FindType.FindByThumbprint, certificateThumbprint, false);
var signingCertificate = certCollection[0];
certStore.Close();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.