Microsoft.IdentityModel.Logging: Strong name signature could not be verified

1

I'm trying to use the Microsoft JWT Library. I have downloaded and compiled the source code, but when I try to run it, I have the following error:

Could not load file or assembly 'Microsoft.IdentityModel.Logging, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)

This is the test code:

uses
  System.IdentityModel.Tokens.Jwt;

// ...

var Handler := new JwtSecurityTokenHandler;
var Payload := new JwtPayload;
var Header  := new JwtHeader;

Header.Add (JwtHeaderParameterNames.X5c,
            array of String (['x5c1', 'x5c2']));

var Token := Handler.WriteToken (new JwtSecurityToken (Header, Payload));

Does anyone knows how to suppress the signing or to verify the signature?

.net
jwt
.net-assembly
adal
oxygene
asked on Stack Overflow Dec 8, 2016 by Patrick8639 • edited Dec 8, 2016 by Romain Lanz

1 Answer

0

Cloning the source code then compiling it and copying the assemblies wasn't successful. Therefore, using NuGet to install the assemblies is working.

NuGet command (in Visual Studio):

PM> Install-Package System.IdentityModel.Tokens.Jwt
answered on Stack Overflow Dec 9, 2016 by Patrick8639

User contributions licensed under CC BY-SA 3.0