如何在OpenID WEB中验证identityserver4生成的ASP.NET连接访问令牌。
情况是
但问题是,如何在ASP.NET API?中验证该令牌??
我可以很容易地在ASP.NET核心API中做到这一点。
,但是我需要解决方案在ASP.NET API中做同样的事情。(不是核心的),谢谢。
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddIdentityServerAuthentication(o =>
{
o.ApiName = "APINameRegisteredInIdentityServer";
o.ApiSecret = "SomeAPISecreteValue";
o.Authority = "MyAuthorityURL";
o.SaveToken = true;
o.SupportedTokens = IdentityServer4.AccessTokenValidation.SupportedTokens.Both;
});发布于 2018-06-13 14:12:27
您可以使用IdentityServer3.AccessTokenValidation OWIN中间件包,甚至对于Identity Server 4令牌- https://github.com/IdentityServer/IdentityServer3.AccessTokenValidation也是如此。
这里有一些样本- https://github.com/IdentityServer/CrossVersionIntegrationTests
https://stackoverflow.com/questions/50839321
复制相似问题