Issue running IdentityServer4

Well, I just closed and reopened Visual Studio 2017, and the problem went away. Perhaps Visual Studio choked on pulling down the IdentityServer4.AccessTokenValidation package the first time, and reopening the project caused it to try again and this time it succeeded.


If you migrate from net core 1.1 to 2.0, you need to migrate your code as described in Identity Server: API Migration to ASP.NET Core 2

In the Configure function

Before:
app.UseIdentityServerAuthentication(new IdentityServerAuthenticationOptions
{
    Authority = "http://localhost:5000",
    RequireHttpsMetadata = false,
    ApiName = "apiApp"
});

After:
app.UseAuthentication();

In the ConfigureServices function

services.AddAuthentication(options =>
{
    options.DefaultAuthenticateScheme = 
                               JwtBearerDefaults.AuthenticationScheme;
    options.DefaultChallengeScheme = 
                               JwtBearerDefaults.AuthenticationScheme;
}).AddJwtBearer(o =>
{
    o.Authority = "http://localhost:5000";
    o.Audience = "apiApp";
    o.RequireHttpsMetadata = false;
});

You need this package. And use the namespace IdentityServer4.AccessTokenValidation