How to Validate OpenID Connect Access Token generated by identityserver4 in ASP.NET WEB API.
The Scenario is
But Question is, How should I validate that Token in my ASP.NET API???
I can easily do that in ASP.NET CORE API .
BUT I NEED Solution to do the same in ASP.NET API. (Not in core) Thanks in advance.
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddIdentityServerAuthentication(o =>
{
o.ApiName = "APINameRegisteredInIdentityServer";
o.ApiSecret = "SomeAPISecreteValue";
o.Authority = "MyAuthorityURL";
o.SaveToken = true;
o.SupportedTokens = IdentityServer4.AccessTokenValidation.SupportedTokens.Both;
});
You can use the IdentityServer3.AccessTokenValidation
OWIN middleware package, even for Identity Server 4 tokens - https://github.com/IdentityServer/IdentityServer3.AccessTokenValidation .
There are samples here - https://github.com/IdentityServer/CrossVersionIntegrationTests
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.