ServiceStack OpenId AuthProviders on Mono

The problem is that OpenId Auth providers do not work under Ubuntu 12.04 with nginx / 1.1.19, Mono JIT compiler version 3.1.1, fastcgi-mono-server4.exe 2.10.0.0

ServiceStack links were pulled through Nuget in version 3.9.55.0, including ServiceStack.Authentication.OpenId, which is connected to DotNetOpenAuth 4.3.0.0

The project is based on the ServiceStack CustomPath40 template, and all projects are built under .NET 4 from VS2012 on Win7x64.

Each auth works fine in IIS8 / IIS8 Express. I configured authproviders in AppHost emulating SocialBootstrapApi. Twitter and Facebook auth work fine on mono, after launch:

mozroots --import --ask-remove 

which trusts typical mozilla certificates.

OpenId providers will complain about the lack of the log4net dll library (again, only mono), but this error is provided when the corresponding log4net dll quiet is provided. OpenId providers (Google and Yahoo) now throw an exception:

  Method not found: 'System.Security.Cryptography.HashAlgorithm.Dispose'. [Auth: 07/26/2013 04:21:13]: [REQUEST: {provider:GoogleOpenId}] System.MissingMethodException: Method not found: 'System.Security.Cryptography.HashAlgorithm.Dispose'. at DotNetOpenAuth.OpenId.HmacShaAssociation/HmacSha.CreateHasher (byte[]) <0x00017> at DotNetOpenAuth.OpenId.HmacShaAssociation.CreateHasher () <0x0001b> at DotNetOpenAuth.OpenId.Association.Sign (byte[]) <0x00034> at DotNetOpenAuth.OpenId.ChannelElements.SigningBindingElement.GetSignature (DotNetOpenAuth.OpenId.ChannelElements.ITamperResistantOpenIdMessage,DotNetOpenAuth.OpenId.Association) <0x001f3> at DotNetOpenAuth.OpenId.ChannelElements.SigningBindingElement.ProcessIncomingMessage (DotNetOpenAuth.Messaging.IProtocolMessage) <0x00133> at DotNetOpenAuth.Messaging.Channel.ProcessIncomingMessage (DotNetOpenAuth.Messaging.IProtocolMessage) <0x001b1> at DotNetOpenAuth.OpenId.ChannelElements.OpenIdChannel.ProcessIncomingMessage (DotNetOpenAuth.Messaging.IProtocolMessage) <0x000f3> at DotNetOpenAuth.Messaging.Channel.ReadFromRequest (System.Web.HttpRequestBase) <0x00359> at DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty.GetResponse (System.Web.HttpRequestBase) <0x00053> at DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty.GetResponse () <0x0006f> at ServiceStack.Authentication.OpenId.OpenIdOAuthProvider.Authenticate (ServiceStack.ServiceInterface.IServiceBase,ServiceStack.ServiceInterface.Auth.IAuthSession,ServiceStack.ServiceInterface.Auth.Auth) <0x00693> at ServiceStack.ServiceInterface.Auth.AuthService.Authenticate (ServiceStack.ServiceInterface.Auth.Auth,string,ServiceStack.ServiceInterface.Auth.IAuthSession,ServiceStack.ServiceInterface.Auth.IAuthProvider) <0x0004f> at ServiceStack.ServiceInterface.Auth.AuthService.Post (ServiceStack.ServiceInterface.Auth.Auth) <0x00247> at ServiceStack.ServiceInterface.Auth.AuthService.Get (ServiceStack.ServiceInterface.Auth.Auth) <0x00013> at (wrapper dynamic-method) object.lambda_method (System.Runtime.CompilerServices.Closure,object,object) <0x0004f> at ServiceStack.ServiceHost.ServiceRunner`1<ServiceStack.ServiceInterface.Auth.Auth>.Execute (ServiceStack.ServiceHost.IRequestContext,object,ServiceStack.ServiceInterface.Auth.Auth) <0x001de> 

The obvious problem will be what is described in detail here: https://bugzilla.xamarin.com/show_bug.cgi?id=3375 , but this is noted as resolved more than a year ago in version 2.10.x, while I built this 3.1 .1 from a tagged source last week.

How can I fix this exception and get OpenId Auth providers to work on Mono?

+2
source share
1 answer

You claim to have installed Mono 3.1.1, but you did not install xsp with the scripts that you used to install this new version of Mono.

This means that when you installed xsp from the packages, you pulled out Mono 2.x as a dependency on it. So, you thought that you removed mono from the packages and installed the new Mono, but in fact you had 2 versions of Mono.

When you run xsp from packages, you execute the binary located in / usr, which means that it uses the old mono (but not the new one that you installed in / usr / local).

Even if you use mono-fastcgi-server4 instead of the xsp server, both servers are basic: the xsp repository, which must be installed next to Mono: http://github.com/xsp

0
source

Source: https://habr.com/ru/post/1493832/


All Articles