ASP.NET Core 3.1 — IdentityServer4 — Segurança (Parte 2)

Atualização

OpenSSL

Instalando o certificado digital

Possibilidades de uso

Thumbprint

if (_webHostEnvironment.IsDevelopment())
identityServer.AddDeveloperSigningCredential();
else
identityServer.AddSigningCredential(“4DFF9B8EBB5314B9A62EFA72DA8B4D7658231C05”, StoreLocation.CurrentUser, NameType.Thumbprint);

Uso do *.pfx direto

if (_webHostEnvironment.IsDevelopment())
identityServer.AddDeveloperSigningCredential();
else
identityServer.AddSigningCredential(new X509Certificate2(“certificate.pfx”, “senha”));

Forma de uso maqueado

using IdentityServer.Extensions;if (_webHostEnvironment.IsDevelopment())
identityServer.AddDeveloperSigningCredential();
else
identityServer.AddCustomSigningCredential();