我有一个ASP.NET MVC4应用程序,它使用DotNetOpenAuth 4.0.1来通过OpenId提供者(谷歌)对用户进行身份验证。在我的开发计算机(localhost)上,所有这些都可以正常工作。
但是,当我将web应用程序部署到服务器(共享托管)时,当我试图进行身份验证时(特别是当我试图创建一个OpenIdRelyingParty时),会出现以下错误:
重写成员时违反继承安全规则:'DotNetOpenAuth.Messaging.ProtocolException.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)'.重写方法的安全可访问性必须与被覆盖的方法的安全可访问性相匹配。
堆栈跟踪:
DotNetOpenAuth.Messaging.ErrorUtilities.VerifyProtocol(Boolean condition, String message, Object[] args) +0
DotNetOpenAuth.Messaging.Channel.ValidateAndPrepareBindingElements(IEnumerable`1 elements) +524
DotNetOpenAuth.Messaging.Channel..ctor(IMessageFactory messageTypeProvider, IChannelBindingElement[] bindingElements) +316
DotNetOpenAuth.OpenId.ChannelElements.OpenIdChannel..ctor(IMessageFactory messageTypeProvider, IChannelBindingElement[] bindingElements) +48
DotNetOpenAuth.OpenId.ChannelElements.OpenIdRelyingPartyChannel..ctor(ICryptoKeyStore cryptoKeyStore, INonceStore nonceStore, RelyingPartySecuritySettings securitySettings) +52
DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty..ctor(ICryptoKeyStore cryptoKeyStore, INonceStore nonceStore) +570
DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty..ctor() +65
MyProject.Controllers.OpenIdController.Authenticate(String returnUrl) in OpenIdController.cs:81
...我听说DotNetOpenAuth在中等信任范围内运行良好,所以我很惊讶地发现了一个错误。我怎么才能修好它?我是否需要修改DotNetOpenAuth源代码,还是有更简单的方法?
这个问题似乎类似于这一个,但我不知道源代码的哪一部分需要编辑。而且,奇怪的是,以前没有人问过这个关于DotNetOpenAuth的问题,所以也许我做错了什么?请帮帮我!
发布于 2012-04-06 18:36:50
看起来,您正在运行针对DotNetOpenAuth 3.5的.NET构建。.NET 4.0引入的一项重大更改是对不同安全属性的要求。你可以从DotNetOpenAuth获取目标为.NET 4.0的.NET构建。
https://stackoverflow.com/questions/10045159
复制相似问题