Create Certificates for IdentityServer4 signing using .NET Core

Nice article

Software Engineering

This article shows how to create certificates for an IdentityServer4 application to use for signing and token validation. The certificates are created using the CertificateManager nuget package. Both RSA and ECDsa certificates can be used for signing in IdentityServer4.

Code:Certificates for IdentityServer4 signing using .NET Core

Creating the Certificates in .NET Core

A simple .NET Core console application is used to create the certificates. This type of application can run on most of the standard operating systems. Create a new console application and add the package CertificateManager. The package Microsoft.Extensions.DependencyInjection is also required to initialize the package.

Creating a RSA certificate

A self signed RSA certificate can be created using the CertificateManager NewRsaSelfSignedCertificate method. The key size must be at least 2048. The following example also adds TLS server and client authentication OID extensions, so that the certificate could also be used for client authentication.

Creating a…

View original post 172 more words

2 thoughts on “Create Certificates for IdentityServer4 signing using .NET Core

    1. Yes, Bert. Idsrv sample code contains AddDeveloperSigningCredential() which is not advised to use in production I guess. We may replace AddDeveloperSigningCredential with above mentioned way.

      Like

Leave a comment