We have an IdentityServer4-based STS successfully running on Windows, where the Signing Credential has been installed to the Local Computer with .pfx under Personal > Certifi
When you use Docker containers and IdentityServer basically you have two options:
COPY certificate.pfx .)-v /path/to/certificate.pfx:/certificate.pfx)Whatever option you choose, the only thing you need is to add the following configuration code to ConfigureServices in Startup
var identityServerBuilder = services.AddIdentityServer();
/* store configuration and etc. is omitted */
if (_hostingEnvironment.IsDevelopment())
{
identityServerBuilder.AddDeveloperSigningCredential();
}
else
{
var certificate = new X509Certificate2("certificate.pfx", "certificate_password");
identityServerBuilder.AddSigningCredential(certificate);
}
Also it would be a good idea to read certificate password from configuration, environment variable or secrets storage.