IdentityServer4 Version="4.1.1" MTLS 配置 services.AddAuthentication().AddCertificate 不工作

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

Startup.cs 设置有问题,根据我应该添加的文档

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

但是我得到了错误:

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

在示例代码设置中 IdentityServer(HOST)/ConsoleMTLSClient 它有效。

您必须添加 Microsoft.AspNetCore.Authentication.Certificate NuGet 包。