问题是 OpenId Auth 提供程序无法在 Ubuntu 12.04 下使用 nginx/1.1.19、Mono JIT 编译器版本 3.1.1、fastcgi-mono-server4.exe 2.10.0.0
ServiceStack 引用均通过 Nuget 提取,版本为 3.9.55.0,包括附加到 DotNetOpenAuth 4.3.0.0 的 ServiceStack.Authentication.OpenId
该项目基于 ServiceStack 模板 CustomPath40,所有项目均在 Win7x64 上使用 VS2012 的 .NET 4 下构建。
每个身份验证在 IIS8/IIS8 Express 下都可以正常工作。我在 AppHost 中配置了 authproviders,模拟了 SocialBootstrapApi。Twitter 和 Facebook 身份验证在单声道上运行良好,一旦运行:
mozroots --import --ask-remove
信任典型的Mozilla证书。
OpenId 提供者会抱怨缺少 log4net dll(同样,仅在单声道上),但提供适当的 log4net dll 可以消除该错误。现在 OpenId 提供者(谷歌和雅虎)都抛出异常:
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>
明显的问题将是这里详述的问题:https://bugzilla.xamarin.com/show_bug.cgi?id=3375,但这在一年前的 2.10.x 中被标记为已解决,而我构建了这个 3.1.1来自上周标记的来源。
如何补救此异常并让 OpenId Auth 提供程序在 Mono 上工作?