JwtSecurityTokenHandler.set_CertificateValidator Method Not Found

A lot of packages for the Azure Mobile Service have just been updated, and now I get a "method not found" error. This does not seem to be the issue reported elsewhere. Any idea which package to downgrade? Or another job?

[MissingMethodException: Method not found: 'Void System.IdentityModel.Tokens.JwtSecurityTokenHandler.set_CertificateValidator(System.IdentityModel.Selectors.X509CertificateValidator)'.] Microsoft.WindowsAzure.Mobile.Service.Security.Providers.GoogleLoginProvider..ctor(HttpConfiguration config, IServiceTokenHandler tokenHandler) +0 lambda_method(Closure , Object[] ) +174 Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() +419 [DependencyResolutionException: An exception was thrown while invoking the constructor 'Void .ctor(System.Web.Http.HttpConfiguration, Microsoft.WindowsAzure.Mobile.Service.Security.IServiceTokenHandler)' on type 'GoogleLoginProvider'. ---> Method not found: 'Void System.IdentityModel.Tokens.JwtSecurityTokenHandler.set_CertificateValidator(System.IdentityModel.Selectors.X509CertificateValidator)'. (See inner exception for details.)] Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() +999 Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +589 Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +109 Autofac.Core.Resolving.InstanceLookup.<Execute>b__0() +63 Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator) +201 Autofac.Core.Resolving.InstanceLookup.Execute() +262 Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) +282 Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) +72 Autofac.Features.Collections.<>c__DisplayClass6.<RegistrationsFor>b__1(IComponentRegistration cr) +60 System.Linq.WhereSelectArrayIterator`2.MoveNext() +66 System.Linq.Buffer`1..ctor(IEnumerable`1 source) +335 System.Linq.Enumerable.ToArray(IEnumerable`1 source) +77 Autofac.Features.Collections.<>c__DisplayClass4.<RegistrationsFor>b__0(IComponentContext c, IEnumerable`1 p) +256 Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +191 Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +109 Autofac.Core.Resolving.InstanceLookup.Execute() +158 Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) +282 Autofac.Core.Resolving.ResolveOperation.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) +60 Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters) +111 Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) +279 Autofac.Core.Container.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) +57 Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance) +175 Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters) +250 Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType, IEnumerable`1 parameters) +72 Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType) +63 Microsoft.WindowsAzure.Mobile.Service.Config.AutofacDependencyScope.GetServices(Type serviceType) +269 System.Web.Http.DependencyScopeExtensions.GetServices(IDependencyScope services) +172 System.Web.Http.DependencyScopeExtensions.GetLoginProviders(IDependencyScope services) +41 Microsoft.WindowsAzure.Mobile.Service.Config.OwinAppBuilder.ConfigureAuthentication(IAppBuilder appBuilder, HttpConfiguration config) +379 Microsoft.WindowsAzure.Mobile.Service.Config.OwinAppBuilder.Configuration(IAppBuilder appBuilder) +70 Microsoft.WindowsAzure.Mobile.Service.<>c__DisplayClass5.<ConfigureOwin>b__4(IAppBuilder appBuilder) +40 Microsoft.WindowsAzure.Mobile.Service.Config.StartupOwinAppBuilder.Configuration(IAppBuilder appBuilder) +234 
+7
azure-mobile-services
source share
4 answers

I had the same problem and I got mobile service again

In the package manager console in VS

remove the package WindowsAzure.MobileServices.Backend.Entity

remove the package WindowsAzure.MobileServices.Backend.Tables

uninstall the WindowsAzure.MobileServices.Backend package

then

WindowsAzure.MobileServices.Backend -Version 1.0.342 installation package

install-package WindowsAzure.MobileServices.Backend.Tables -Version 1.0.342

install-package WindowsAzure.MobileServices.Backend.Entity -Version 1.0.342

Not sure why this is happening though

+10
source share

Ok guys, I finally found the problem because Paul advises. This is due to the version of the System.IdentityModel.Tokens.Jwt 4.0.0 package.

In fact, updating the Microsoft.Owin.Security.ActiveDirectory package from 2.1.0 to 3.0.0 leads to updating the Jwt package from 3.0.2 to 4.0.0

The workaround is to restore both ActiveDirectory to 2.1.0 and Jwt to 3.0.2, then press F5 and access AMS 439.

 install-package System.IdentityModel.Tokens.Jwt -version 3.0.2 
+4
source share

Same issue here after updating ams nuget pkg. The rollback worked, but this is more a workaround than a solution.

Edit: you can roll back to version 405.

+2
source share

My team is still investigating this problem and I do not have all the information yet, but so far I have noticed that upgrading to 439 does not cause a problem. You can verify this yourself by creating a new mobile service in the visual studio, then go to NuGet and upgrade the Mobile Services.NET Backend Entity Framework to the latest version (439). Once the update is complete, press F5 and you will see that the service loads normally without any errors.

I was able to reproduce the problem by selecting the Microsoft.Owin.Security.ActiveDirectory package and upgrading it from 2.1.0 to 3.0.0. Of course, selecting the Update All option in NuGet will achieve the same (and much more).

As we continue to figure out what the exact fix is, can you confirm that upgrading to 439 without upgrading to AD 3.0.0 fixes the problem?

0
source share

All Articles