Search code examples
identityserver4mtls

IdentityServer4 Version="4.1.1" MTLS configuration services.AddAuthentication().AddCertificate not working


Problem with Startup.cs setup, according to documentation I should add

services.AddAuthentication()
    .AddCertificate(options =>
    {
        options.AllowedCertificateTypes = CertificateTypes.All;
        options.RevocationMode = X509RevocationMode.NoCheck;
    });

But I got error:

'AuthenticationBuilder' does not contain a definition for 'AddCertificate' and there is no extension method 'AddCertificate'.

In samples code setup IdentityServer(HOST)/ConsoleMTLSClient it works .


Solution

  • You have to add the Microsoft.AspNetCore.Authentication.Certificate NuGet package.