Identity Server 4错误“键集丢失”

Roc*_*bin 10 identityserver4

在我配置EntityFramework之后,代码无法正常工作,我只是喜欢将doc int此页面身份服务器4官方文档

就像文档在页面最后说的那样:“您现在应该能够运行任何现有的客户端应用程序并登录,获取令牌并调用API –全部基于数据库配置。” 但是,当我运行控制台应用程序时,无论服务器信息看起来是否正常,我都会看到以下错误,这是发现文档。我确定我是在客户端之前启动服务器的。我找不到原因或与Google和Stack Overflow相关的问题。我想知道“缺少密钥集”的含义,以及如何解决它。

Til*_*ilo 16

您是否添加了以下内容?

public void ConfigureServices(IServiceCollection services)
{
    services.AddIdentityServer()
            .AddDeveloperSigningCredential()....
}
Run Code Online (Sandbox Code Playgroud)

未添加时出现以下错误。

System.InvalidOperationException: Policy error while contacting the discovery endpoint http://localhost:5050/.well-known/openid-configuration: Keyset is missing
       at IdentityModel.AspNetCore.OAuth2Introspection.PostConfigureOAuth2IntrospectionOptions.<GetIntrospectionEndpointFromDiscoveryDocument>d__3.MoveNext() 
Run Code Online (Sandbox Code Playgroud)

非常令人讨厌的是,这从未记录。

PS,您必须在测试之前重新启动客户端。客户端调用仅一次发现。