1
votes

New to OIDC and Azure AD B2C.

Working my way through the demo sample at

The demo worked fine, over .NET 4.6.1... Hence committed to delivering it within an existing app.

Spoke too soon: when integrated into an existing app, again based on .NET 4.6.1, already using later Microsoft.Owin.* Nuget packages, I cannot get the solution to work.

Specifically (for starters?):

Even after updating references of JwtFormat and other classes to using Microsoft.Owin.Security.Jwt, the following can no longer be compiled:

 AccessTokenFormat = new JwtFormat(tvps, new OpenIdConnectCachingSecurityTokenProvider(String.Format(AadInstance, Tenant, DefaultPolicy)))

within the following page:

https://github.com/Azure-Samples/active-directory-b2c-dotnet-webapp-and-webapi/blob/master/TaskService/App_Start/Startup.Auth.cs

The issue is quickly demonstrated by

  • downloading the git
  • compiling
  • Updating the nuget packages to latest versions
  • unable to compile...

I guess the questions are:

  • Is there a new way to integrate with Azure AD B2C over OIDC that has been developed, and the above code is no longer best practice (if so, where could I find documentation and preferably a new sample)
  • If the above demo remains relevant...what/where should I change to make it work?
  • Is the only option forward to work with Azure AD B2C (at this point in time) to roll the whole team back to earlier versions of Microsoft.Owin* Assemblies?
1
Please share the error you are receiving.Brent Schmaltz
check the package config dll versions of various assemblies from git sample and compare with your package config versions. If you see any assembly is lower in your package than git package that might cause the issue.Ramakrishna

1 Answers

1
votes

Newer versions of 'Microsoft.Owin.Security.Jwt' is not compatible. Install 4.0.4.403061554 of 'Microsoft.Owin.Security.Jwt'. It should work. The github solution that you're referring to used even lower version of JWT package