【问题标题】:Using an Identity Server signing certificate in Azure在 Azure 中使用 Identity Server 签名证书
【发布时间】:2017-01-03 13:02:01
【问题描述】:

在 IdentityServer 示例代码(startup.cs)中,我们可以看到如何使用证书:

var certFile = env.ApplicationBasePath + "\\idsrv3test.pfx";

var signingCertificate = new X509Certificate2(certFile, "idsrv3test");

如果我将 STS 作为 Web 应用服务部署到 Azure,如何在生产环境中执行此操作?

为了安全起见,我知道我无法将 pfx 文件添加到解决方案中。

【问题讨论】:

    标签: c# azure identityserver3


    【解决方案1】:

    将证书上传到门户:

    https://docs.microsoft.com/en-us/azure/app-service-web/web-sites-configure-ssl-certificate#step-2-upload-and-bind-the-custom-ssl-certificate

    现在您可以通过以下方式获得证书:

            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();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多