Hopefully someone can point me in the right direction, I need to validate the access token issued by identity server 4 in my api.
Authorized attribute is already set in the API.
Access token is retrieved correctly from server, but when passsing the access token to the request, i got an 401 Unauthorized error, and nothing is processed the request is rejected. I am using IdentityServer3.AccessTokenValidation nuget package.
I noticed for v4 of the AccessTokenValidation you can set RequireHttpsMetadata = false but i dont see how in v3.
Is this the best way to do this or should i be looking into another direction ?
public void ConfigureAuth(IAppBuilder app)
{
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = "Cookies",
});
JwtSecurityTokenHandler.InboundClaimTypeMap = new Dictionary<string,
string>
();
app.UseIdentityServerBearerTokenAuthentication
(new IdentityServerBearerTokenAuthenticationOptions
{
Authority = "http://localhost:5000",
RequiredScopes = new[] { "api2" },
});
}
Thanks