2017-09-27 142 views
0

可能有人帮助我这一点。在过去的几周里,我一直在学习如何使用Identity Server 4以及如何通过使用Id4作为单独的应用程序来实现隐式流,作为客户端(独立应用程序)的角度4和作为第三方的asp.net核心API。身份服务器4没有安全令牌验证器可用于令牌

我设法从id4服务器发出id和访问令牌,当我想调用api时,将访问令牌添加到授权头中。但我没有SecurityTokenValidator可用于令牌为错误。

那么我做错了什么?

我正在使用的内存测试数据和AddDeveloperSigningCredential: enter image description here

而且在API方面我得到这个: enter image description here

我用UseJwtBearerAuthentication中间件在API方面: enter image description here

谢谢提前。

回答

0

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

我会附上我的api项目的启动类,也许它可以帮助某人。

enter image description here

enter image description here

相关问题