DotNetOpenAuth ...在服务器上断开CreatRequest(在我的机器上工作;

我已经创建了一个基于ASP.NET MVC 4 Web应用程序的网站。 按照AuthConfig.cs中的说明,我已经为Twitter,Facebook和Google启用了OpenAuth登录提供程序。

当IIS Express上的Visual Studio在我的本地计算机上调试站点时,此工作正常。 但是,当我将该网站复制到另一台计算机上时,整个网站都会结束,除了使用开放式身份验证的任何网站。

在这台机器上,我可以使用浏览器访问twitter,facebook和google。

当我尝试使用我的网站登录时,我得到:对于Google:“ 序列不包含元素 ”,堆栈跟踪指向

[InvalidOperationException:Sequence不包含元素] System.Linq.Enumerable.First(IEnumerable`1 source)+514 DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty.CreateRequest(Identifier userSuppliedIdentifier,Realm realm,Uri returnToUrl)+106

[ProtocolException:找不到OpenID端点。] DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty.CreateRequest(标识符userSuppliedIdentifier,Realm realm,Uri returnToUrl)+303 DotNetOpenAuth.AspNet.Clients.OpenIdClient.RequestAuthentication(HttpContextBase上下文,Uri returnUrl)+135 DotNetOpenAuth。在d: dtaylor Documents Visual Studio 2012 Projects NotesBoard NotesBoard Controllers AccountController.cs中的AspNet.OpenAuthSecurityManager.RequestAuthentication(String returnUrl)+666 NotesBoard.Controllers.ExternalLoginResult.ExecuteResult(ControllerContext上下文):369 System.Web .Mvc。<> c_DisplayClass1a.b_17()+33 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter,ResultExecutingContext preContext,Func 1 continuation) +613 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func 1继续)+613 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerC (IAsyncResult asyncResult)+28系统控制器上下文控制器上下文, .Web.Mvc.Async。<> c_DisplayClass4.b_3(IAsyncResult ar)+15 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)+53 System.Web.Mvc.Async。<> c_DisplayClass4.b_3(IAsyncResult ar) +15 System.Web.Mvc。<> c_DisplayClass8.b_3(IAsyncResult asyncResult)+42 System.Web.Mvc.Async。<> c_DisplayClass4.b_3(IAsyncResult ar)+15 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication。 IExecutionStep.Execute()+606 System.Web.HttpApplication.ExecuteStep(IExecutionStep步骤,布尔&完成同步)+288

对于Twitter,我得到:“ 连接尝试失败,因为连接方在一段时间后没有正确响应,或者建立的连接失败,因为连接的主机未能响应199.16.156.72:443 ”以及以下堆栈跟踪

[SocketException(0x274c):连接尝试失败,因为连接方在一段时间后没有正确响应,或建立的连接失败,因为连接的主机未能响应199.16.156.72:443] System.Net.Sockets.Socket.DoConnect (EndPoint endPointSnapshot,SocketAddress socketAddress)+273 System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure,Socket s4,Socket s6,套接字和套接字,IP地址和地址,ConnectSocketState状态,IAsyncResult异步结果,异常和异常)+584

[WebException:无法连接到远程服务器] System.Net.HttpWebRequest.GetResponse()+8527180 DotNetOpenAuth.Messaging.StandardWebRequestHandler.GetResponse(HttpWebRequest请求,DirectWebRequestOptions选项)+261

[ProtocolException:发送直接消息或获取响应时发生错误。] DotNetOpenAuth.Messaging.StandardWebRequestHandler.GetResponse(HttpWebRequest请求,DirectWebRequestOptions选项)+1862 DotNetOpenAuth.Messaging.Channel.RequestCore(IDirectedProtocolMessage请求)+516 DotNetOpenAuth.Messaging.Channel .Request(IDirectedProtocolMessage requestMessage)+132 DotNetOpenAuth.Messaging.Channel.Request(IDirectedProtocolMessage requestMessage)+45 DotNetOpenAuth.OAuth.ConsumerBase.PrepareRequestUserAuthorization(Uri callback,IDictionary 2 requestParameters, IDictionary 2 redirectParameters,String&requestToken)+202 DotNetOpenAuth.AspNet.Clients .dotNetOpenAuthWebConsumer.RequestAuthentication(Uri回调)在d: dtaylor Documents Visual Studio 2012 Projects NotesBoard 中使用+86 DotNetOpenAuth.AspNet.OpenAuthSecurityManager.RequestAuthentication(String returnUrl)+666 NotesBoard.Controllers.ExternalLoginResult.ExecuteResult(ControllerContext上下文) NotesBoard CONTRO llers AccountController.cs:369 System.Web.Mvc。<> c_DisplayClass1a.b_17()+33 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter,ResultExecutingContext preContext,Func 1 continuation) +613 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func 1 continuation)+613 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext,IList`1 filters,ActionResult actionResult)+263 System.Web.Mvc.Async。<> c_DisplayClass25 .b_22(IAsyncResult asyncResult)+240 System.Web.Mvc。<> c_DisplayClass1d.b_18(IAsyncResult asyncResult)+28 System.Web.Mvc.Async。<> c_DisplayClass4.b_3(IAsyncResult ar)+15 System.Web.Mvc。 Controller.EndExecuteCore(IAsyncResult asyncResult)+53 System.Web.Mvc.Async。<> c_DisplayClass4.b_3(IAsyncResult ar)+15 System.Web.Mvc。<> c_DisplayClass8.b_3(IAsyncResult asyncResult)+42 System.Web.Mvc .Async。<> c_DisplayClass4.b_3(IAsyncResult ar)+15 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()+606 System.Web.HttpApplication.ExecuteStep(IExecutionStep step,Boolean&completedSynchronously)+288

另一方面,Facebook实际上会提示我输入用户名和密码,但随后又回来了:“ 连接尝试失败,因为连接方在一段时间后没有正确响应,或者由于连接的主机未能响应而建立的连接失败173.252 .100.27:443 “和以下堆栈跟踪:

[SocketException(0x274c):连接尝试失败,因为连接方在一段时间后没有正确响应,或者由于连接的主机未能响应而建立连接失败173.252.100.27:443] System.Net.Sockets.Socket.DoConnect (EndPoint endPointSnapshot,SocketAddress socketAddress)+273 System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure,Socket s4,Socket s6,套接字和套接字,IP地址和地址,ConnectSocketState状态,IAsyncResult异步结果,异常和异常)+584

[WebException:无法连接到远程服务器] System.Net.WebClient.DownloadDataInternal(Uri address,WebRequest&request)+3624556 System.Net.WebClient.DownloadString(Uri address)+213 DotNetOpenAuth.AspNet.Clients.FacebookClient.QueryAccessToken Uri returnUrl,String authorizationCode)+399 DotNetOpenAuth.AspNet.Clients.OAuth2Client.VerifyAuthentication(HttpContextBase context,Uri returnPageUrl)+186 DotNetOpenAuth.AspNet.OpenAuthSecurityManager.VerifyAuthentication(String returnUrl)+502 Microsoft.Web.WebPages.OAuth.OAuthWebSecurity.VerifyAuthenticationCore (HttpContextBase上下文,字符串returnUrl)+250 NotesBoard.Controllers.AccountController.ExternalLoginCallback(String returnUrl)在d: dtaylor Documents Visual Studio 2012 Projects NotesBoard NotesBoard Controllers AccountController.cs中:225 lambda_method(Closure,ControllerBase ,Object [])+127 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext,IDictionary 2 parameters) +274 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary 2 parameters) +274 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary 2 parameters)+39 System.Web.Mvc.Async。<> c_DisplayClass39.b_33()+120 System.Web.Mvc.Async。<> c_DisplayClass4f.b_49( )+452 System.Web.Mvc.Async。<> c_DisplayClass4f.b_49()+452 System.Web.Mvc.Async。<> c_DisplayClass37.b_36(IAsyncResult asyncResult)+15 System.Web.Mvc.Async。<> c_DisplayClass2a .b_20()+33 System.Web.Mvc.Async。<> c_DisplayClass25.b_22(IAsyncResult asyncResult)+240 System.Web.Mvc。<> c_DisplayClass1d.b_18(IAsyncResult asyncResult)+28 System.Web.Mvc.Async。 <> c_DisplayClass4.b_3(IAsyncResult ar)+15 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)+53 System.Web.Mvc.Async。<> c_DisplayClass4.b_3(IAsyncResult ar)+15 System.Web.Mvc <> c_DisplayClass8.b_3(IAsyncResult asyncResult)+42 System.Web.Mvc.Async。<> c_DisplayClass4.b_3(IAsyncResult ar)+15 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()+606 System.Web.HttpApplication.ExecuteStep(IExecutionStep步骤,布尔&完成同步)+288

PS。 值得一提的是,我们通过在IE中的服务器上设置的代理访问互联网。 我没有在提供的模板中找到允许我指定代理服务器等的任何代码。

请帮助。


我想我能解决这个问题。 事实证明,我们的代理服务器似乎是问题所在。 我有在IIS中运行此站点的应用程序池配置为使用NetworkServices作为应用程序池标识。 我改变了自己的身份,以确定问题是否已经解决。 显然,不建议将网站作为用户帐户运行,因此我将要求我们的IT团队为该网站创建一个域帐户,该帐户也可以通过我们的代理服务器访问。

我希望能帮助其他人有同样的问题。

链接地址: http://www.djcxy.com/p/72693.html

上一篇: DotNetOpenAuth...CreatRequest breaks on server (Works on my machine ;

下一篇: Index Out of Range Databinding