Mono上的ServiceStack OpenId AuthProviders [英] ServiceStack OpenId AuthProviders on Mono

查看:123
本文介绍了Mono上的ServiceStack OpenId AuthProviders的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题在于OpenId身份验证提供程序无法在具有nginx / 1.1.19,Mono JIT编译器版本3.1.1,fastcgi-mono-server4.exe 2.10.0.0的Ubuntu 12.04下工作

The problem is that OpenId Auth providers aren't working under Ubuntu 12.04 with nginx/1.1.19, Mono JIT compiler version 3.1.1, fastcgi-mono-server4.exe 2.10.0.0

所有通过Nuget提取的ServiceStack引用的版本均为3.9.55.0,包括附加到DotNetOpenAuth 4.3.0.0的ServiceStack.Authentication.OpenId

The ServiceStack references were all pulled via Nuget are at version 3.9.55.0, including ServiceStack.Authentication.OpenId which is attached to DotNetOpenAuth 4.3.0.0

该项目基于ServiceStack模板CustomPath40,并且所有项目都是在Win7x64上使用VS2012在.NET 4下构建的。

The project is based on the ServiceStack Template CustomPath40 and all of the projects are built under .NET 4 with VS2012 on Win7x64.

在IIS8 / IIS8下,每个身份验证都可以正常工作表现。我在AppHost中配置了authprovider,模拟了SocialBootstrapApi。一旦运行,Twitter和Facebook身份验证就可以在mono上正常工作。

Every auth works perfectly fine under IIS8/IIS8 Express. I configured the authproviders in AppHost, emulating the SocialBootstrapApi. Twitter and Facebook auth works just fine on mono, once running:

 mozroots --import --ask-remove

信任典型的Mozilla证书。

that trusts typical mozilla certs.

OpenId提供程序将抱怨缺少log4net dll(再次,仅在mono上),但是提供适当的log4net dll可以使该错误消失。现在,OpenId提供程序(Google和Yahoo)都抛出异常:

The OpenId providers will complain about lacking a log4net dll (again, only on mono), but supplying an appropriate log4net dll quiets that error. Now the OpenId providers (Google and Yahoo) both 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>

明显的问题是此处详细介绍的问题: https://bugzilla.xamarin.com/show_bug.cgi?id=3375 ,但这被标记为已解决一年多以前在2.10.x中,而我上周是从标记源构建此3.1.1的。

The obvious problem would be the one detailed here: https://bugzilla.xamarin.com/show_bug.cgi?id=3375, but this is marked as resolved over a year ago in 2.10.x, while I built this 3.1.1 from tagged source last week.

我该如何解决此异常并使OpenId Auth提供程序在Mono上工作?

How can I remedy this exception and get the OpenId Auth providers working on Mono?

推荐答案

您声称已安装了Mono 3.1.1,但并未使用用于安装此脚本的脚本来安装xsp新版本的Mono。

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

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

This means then, that when you installed xsp from packages, you pulled in Mono 2.x as a dependency of it. So you thought you had uninstalled mono from packages, and installed a new Mono, but you were actually having 2 versions of Mono at the same time.

从软件包中运行xsp时,您正在/ bin上运行二进制文件,这意味着它正在使用旧的mono(而不是您在/ usr / local中安装的新版本)。

When running xsp from packages, you where running the binary located at /usr, which means it was using the old mono (not the new one that you installed in /usr/local).

甚至如果您运行的是 mono-fastcgi-server4 而不是xsp服务器,则两个服务器的代码库是通用的:xsp repo,您​​需要将其与Mono一起安装: http://github.com/xsp

Even if you're running mono-fastcgi-server4 instead of the xsp server, both servers codebase is common: the xsp repo, which you need to install alongside Mono: http://github.com/xsp

这篇关于Mono上的ServiceStack OpenId AuthProviders的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆