servicestack,ubuntu-12.04,dotnetopenauth,Mono,servicestack,Ubuntu 12.04,Dotnetopenauth" /> servicestack,ubuntu-12.04,dotnetopenauth,Mono,servicestack,Ubuntu 12.04,Dotnetopenauth" />

Mono上的ServiceStack OpenId身份验证提供程序

Mono上的ServiceStack OpenId身份验证提供程序,mono,servicestack,ubuntu-12.04,dotnetopenauth,Mono,servicestack,Ubuntu 12.04,Dotnetopenauth,问题是OpenId身份验证提供程序不能在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,所有项目都在.NET 4下构建

问题是OpenId身份验证提供程序不能在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,所有项目都在.NET 4下构建,并在Win7x64上使用VS2012

在IIS8/IIS8 Express下,每个auth都可以正常工作。我在AppHost中配置了authproviders,模拟了SocialBootstrapApi。Twitter和Facebook auth在mono上运行正常:

 mozroots --import --ask-remove
它信任典型的mozilla证书

OpenId提供者会抱怨缺少log4netdll(同样,仅在mono上),但提供适当的log4netdll可以消除该错误。现在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>
未找到方法:“System.Security.Cryptography.HashAlgorithm.Dispose”。 [授权:07/26/2013 04:21:13]: [请求:{provider:GoogleOpenId}]System.MissingMethodException:找不到方法:“System.Security.Cryptography.HashAlgorithm.Dispose”。在 DotNetOpenAuth.OpenId.HmacShaAssociation/HmacSha.CreateHasher(字节[])位于 DotNetOpenAuth.OpenId.HmacShaAssociation.CreateHasher()位于 DotNetOpenAuth.OpenId.Association.Sign(字节[])位于 DotNetOpenAuth.OpenId.ChannelElements.SigningBindingElement.GetSignature(DotNetOpenAuth.OpenId.ChannelElements.ItamperResistantOpenMessage,DotNetOpenAuth.OpenId.Association)位于 DotNetOpenAuth.OpenId.ChannelElements.SigningBindingElement.ProcessIncomingMessage(DotNetOpenAuth.Messaging.IProtocolMessage)位于 DotNetOpenAuth.Messaging.Channel.ProcessIncomingMessage(DotNetOpenAuth.Messaging.IProtocolMessage)位于 DotNetOpenAuth.OpenId.ChannelElements.OpenIdChannel.ProcessIncomingMessage(DotNetOpenAuth.Messaging.IProtocolMessage)位于 DotNetOpenAuth.Messaging.Channel.ReadFromRequest(System.Web.HttpRequestBase)位于 DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty.GetResponse(System.Web.HttpRequestBase)位于 DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty.GetResponse()位于 ServiceStack.Authentication.OpenId.OpenIdOAuthProvider.Authentication(ServiceStack.ServiceInterface.IServiceBase,ServiceStack.ServiceInterface.Auth.IAuthSession,ServiceStack.ServiceInterface.Auth.Auth)位于 ServiceStack.ServiceInterface.Auth.AuthService.Authenticate(ServiceStack.ServiceInterface.Auth.Auth,字符串,ServiceStack.ServiceInterface.Auth.IAuthSession,ServiceStack.ServiceInterface.Auth.IAuthProvider)位于 ServiceStack.ServiceInterface.Auth.AuthService.Post(ServiceStack.ServiceInterface.Auth.Auth)位于 ServiceStack.ServiceInterface.Auth.AuthService.Get(ServiceStack.ServiceInterface.Auth.Auth)位于 (包装器动态方法)object.lambda_方法(System.Runtime.CompilerServices.Closure,object,object) ServiceStack.ServiceHost.ServiceRunner`1.Execute(ServiceStack.ServiceHost.IRequestContext,对象,ServiceStack.ServiceInterface.Auth.Auth) 明显的问题是这里详述的一个:,但这在一年前的2.10.x中被标记为已解决,而我上周从标记的源代码构建了这个3.1.1


如何纠正此异常并使OpenId身份验证提供程序在Mono上工作?

您声称已安装Mono 3.1.1,但您没有使用用于安装此新版本Mono的脚本安装xsp

这意味着,当您从包中安装xsp时,您将Mono 2.x作为它的依赖项。所以你认为你已经从软件包中卸载了mono,并安装了一个新的mono,但实际上你同时拥有两个版本的mono

当从包中运行xsp时,您可以在/usr中运行二进制文件,这意味着它使用的是旧的mono(不是您在/usr/local中安装的新mono)


即使您运行的是
mono-fastcgi-server4
而不是xsp服务器,这两个服务器的代码库都是通用的:您需要与mono一起安装的xsp repo:

似乎是一个坏掉的mono安装,你是如何安装Mono 3.x的?@knocte这是我写的脚本:从几篇博文中提取你的脚本中没有将xsp安装到/usr/local中,因此你将xsp与Mono的两个版本混合,这两个版本变得相互冲突,请阅读@knocte感谢你的快速回复。那么那些导出的bash变量会将构建更改到不同的位置?我想删除任何现有的mono,而不是同时运行两个。另外,也许我的理解是有缺陷的(对于这个环境来说是新的),但我试图使用mono-fastcgi-server4作为nginx和mono之间的连接点。这不是XSP的替代方案吗?我将更多的完整脚本包含到了mono-fastcgi-server4中,并使用apt get引入mono-fastcgi-server4。我应该从某个地方的源代码构建它吗?当我说xsp时,我指的不是xsp服务器,而是xsp repo(包括mono fastcgi):