Identity Server 4 没有可用于令牌的安全令牌验证器

Identity Server 4 No Security Token Validator available for token

有人可以帮我解决这个问题吗?在过去的几周里,我一直在学习如何使用 Identity Server 4 以及如何通过将 Id4 用作单独的应用程序、angular 4 作为客户端(单独的应用程序)和 asp.net 核心 api作为第三个。

我设法从 id4 服务器发出 ID 和访问令牌,在我想调用 api 时将访问令牌添加到授权 header 中。但是我收到 No SecurityTokenValidator available for token 作为错误。

那我做错了什么?

我正在使用 In Memory 测试数据和 AddDeveloperSigningCredential:

而在 api 方面,我得到了这个:

我在 api 端使用 UseJwtBearerAuthentication 中间件:

提前致谢。

最后我解决了这个问题。我将 asp.net 核心更新到版本 2,并在 Api 项目的 Startup class 中添加了新的 AspNetCore Authentication JwtBearer 中间件,现在一切正常。

我会附上我的 api 项目的 Startup class,也许它可以帮助某人。