How to Configuring IdentityServer to Access Store Certificate in my .NET 5 Webassembly App?

Posted 3 years ago by Andreas
0

Hello Everyone,

I was able to deploy my website to the production host (www.smarterasp.org). I bought a ssl certificate with them. If I configure my appsettings.json as seen below and manually copy my certificate (pfx) ito the wwwroot folder all works. How would I now configure my IdentityServer in appsettings.json to use not the physical file certificate (pfx) but use the certificate from the store of my Host? I attached a sample I found for Azure, but not sure how to configure it exactly?

Any help would help me greatly! Thanks, Kind blessings, Andreas

  "IdentityServer": {
   "Key": {
     "Type": "File",
     "FilePath": "wwwroot\\www.xxxx.com.pfx",
     "Password": "123456"
   },
   "Clients": {
     "xxxx.Client": {
       "Profile": "IdentityServerSPA"
     }
   }
 },

Azure:

"IdentityServer": {
  "Key": {
    "Type": "Store",
    "StoreName": "My",
    "StoreLocation": "CurrentUser",
    "Name": "CN=yourApp-domain.com"
  }
}
  • 0

    Something like this

    var cert = new X509Certificate2(Path.Combine(ContentPath, "custom-name.pfx"), "custom-pwd");

    ....

    services.AddIdentityServer().AddSigningCredential(cert); // Microsoft.Extensions.DependencyInjection IdentityServerBuilderExtensionsCrypto

    Posted 2 years ago by alex56903
Someone is typing...

Post a Reply

You must be logged in to add a new post.
Number of online users: 0
An error has occurred. This application may no longer respond until reloaded. Reload 🗙