Identityserver4: Could not load type 'System.IdentityModel.Tokens.TokenValidationParameters' from assembly 'System.IdentityModel.Tokens.Jwt, Version=5.0.0.127

Created on 3 Jul 2016  路  5Comments  路  Source: IdentityServer/IdentityServer4

I've been doing the "Getting Started: JS Authentication & Web APIs" guide,
At part 2 when running the web api i get the following exception :
"Could not load type 'System.IdentityModel.Tokens.TokenValidationParameters' from assembly 'System.IdentityModel.Tokens.Jwt, Version=5.0.0.127, Culture=neutral"

The configuration used in the Startup :

        app.UseCors(CorsOptions.AllowAll);

        app.UseIdentityServerBearerTokenAuthentication(new IdentityServerBearerTokenAuthenticationOptions
        {
            Authority = "https://localhost:44300",


            ClientId = "api",
            ClientSecret = "api-secret",

            RequiredScopes = new[] { "api" }
        });


        var httpConfiguration = new HttpConfiguration();
        httpConfiguration.MapHttpAttributeRoutes();
        httpConfiguration.Filters.Add(new AuthorizeAttribute());

        app.UseWebApi(httpConfiguration);

Any ideas to what can be done?

Most helpful comment

access token validation in OWIN is not compatible with system.identitymodel v5 - you need to downgrade to v4.

All 5 comments

I am confused. The walkthrough is for identityserver3 - but this is the identityserver4 repo.

You are right. excuse me for the mistake,
I should have posted the issue on "IdentityServer3.AccessTokenValidation"

access token validation in OWIN is not compatible with system.identitymodel v5 - you need to downgrade to v4.

OWIN (Katana) has been upgraded to work with IdentityModel v5.
see: https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/wiki/Migrating-from-Katana-(OWIN)-3.x-to-4.x

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings