【问题标题】:Identity Server 4 No Security Token Validator available for tokenIdentity Server 4 没有可用于令牌的安全令牌验证器
【发布时间】:2018-03-08 13:41:52
【问题描述】:

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

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

那么我做错了什么?

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

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

我在 api 端使用 UseJwtBearerAuthentication 中间件:

提前致谢。

【问题讨论】:

    标签: asp.net-core oauth-2.0 jwt identityserver4


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-11-29
      • 2020-12-07
      • 2019-08-31
      • 2013-02-12
      • 1970-01-01
      • 2017-06-29
      • 1970-01-01
      相关资源
      最近更新 更多