IdentityServer3.AccessTokenValidation icon indicating copy to clipboard operation
IdentityServer3.AccessTokenValidation copied to clipboard

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

Open ahokkonen-dev opened this issue 8 years ago • 2 comments

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?

ahokkonen-dev avatar Feb 28 '17 16:02 ahokkonen-dev

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

brockallen avatar Apr 11 '17 13:04 brockallen

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

ahokkonen-dev avatar Apr 27 '17 06:04 ahokkonen-dev