IdentityModel.OIDCClient - WinForm to WiseJ. System.Runtime.CompilerServices.Unsafe issue

0
0

Hi,

I’ve been going around in circles and I’ve hit a brick wall.

I have a successful working OIDC test app (see TESTING.OIDCWINFORM.cs attached).  I only manually add the IdentityModel.OIdcClient Nuget but it has dependencies:

 

IdentityModel.5.2.0
IdentityModel.OidcClient.5.2.1
Microsoft.Bcl.AsyncInterfaces.6.0.0
Microsoft.Extensions.DependencyInjection.6.0.0
Microsoft.Extensions.DependencyInjection.Abstractions.6.0.0
Microsoft.Extensions.Logging.6.0.0
Microsoft.Extensions.Logging.Abstractions.6.0.0
Microsoft.Extensions.Options.6.0.0
Microsoft.Extensions.Primitives.6.0.0
System.Buffers.4.5.1
System.Diagnostics.DiagnosticSource.6.0.0
System.Memory.4.5.4
System.Numerics.Vectors.4.5.0
System.Runtime.CompilerServices.Unsafe.6.0.0
System.Text.Encodings.Web.5.0.1
System.Text.Json.5.0.2
System.Threading.Tasks.Extensions.4.5.4
System.ValueTuple.4.5.0

When I transplant the code into a wiseJ project (with a few changes for example the webBrowser control – also attached as TESTING.WJWEBCORE.cs) I can run the project but an odd error is thrown which prevents the authentication process:

Could not load file or assembly ‘System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The located assembly’s manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)

I’ve tried to remove this module (defaults to 6.0.0) and install an older version (and manually referencing) but this seems to break the IdentityModel.Oidcclient and it reports errors saying that it can’t contact the IDP (which I know is correctly entered and online as the Winform app confirms).

Do you have any idea what this conflict is?

 

  • ALEX PARKER
    I’ve manually confirmed the same file exists in both the winform and the wisej bin
  • You must to post comments
0
0

Hi Alex,

Attached is a sample for using OpenID in .NET 4.8 with Wisej.NET.

HTH,
Alaa

Attachment
  • ALEX PARKER
    Hi Alaa, Thank you – – I’ve not used the Microsoft.Owin packages before. Have you actually been able to see this working? I made the necessary changes to connect to OneLogin instead of Azure but after successfully authenticating and being redirected back, Application.IsAuthenticated never returns ‘true’. I see a set-cookie response so i don’t think its anything IDP side – it seems that it’s just not being recognised on the app side. I should add OnAuthenticationFailed is never fired.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.