IdentityServer / IdentityServer3.AccessTokenValidation

OWIN Middleware to validate access tokens from IdentityServer3
Apache License 2.0
90 stars 150 forks source link

System.IdentityModel.Tokens.Jwt 4.0.4.402070948 is not compatible? #139

Open ahokkonen-dev opened 7 years ago

ahokkonen-dev commented 7 years ago

After upgrading IdentityServer3.AccessTokenValidation 2.13.0->2.14.0 in my WebApi -project I also upgraded System.IdentityModel.Tokens.Jwt -library 4.0.3.308261200->4.0.4.402070948.

Right after that next error started to occur:

An exception of type 'System.IO.FileLoadException' occurred in mscorlib.dll but was not handled in user code

Additional information: Could not load file or assembly 'System.IdentityModel.Tokens.Jwt, Version=4.0.20622.1351, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Error throws on WebApi's Startup.cs:

            app.UseIdentityServerBearerTokenAuthentication(new IdentityServerBearerTokenAuthenticationOptions
            {
                Authority = "identityauthority endpoint",
                RequiredScopes = new[] { "secure.api" }
            });

Wondering why v4.0.20622.1351 is now required when it was earlier ok with v4.0.3.308261200. Also interesting that missed version is mentioned as 4.0.20622.1351, not 4.0.2.206221351

Any clues?

brockallen commented 7 years ago

Hmm, not sure. We've not seen that issue before. Sorry.

ahokkonen-dev commented 7 years ago

It magically solved by updating all owin -libraries to latest version 3.1.0. Looks like Microsoft.Owin.Security.Jwt library v3.0.1 had (forced?) references to 4.0.20622.1351 verson