This code works perfect fine on local machine but on my staging servers I am getting this issue every now and then. And after few min, it will just go away.
I even increased time out in web.config
<messaging clockSkew="00:10:00" lifetime="00:03:00" strict="true"> <untrustedWebRequest timeout="00:10:30" readWriteTimeout="00:10:30.500"> <whitelistHosts> <!-- Uncomment to enable communication with localhost (should generally not activate in production!) --> <!--<add name="localhost" />--> </whitelistHosts></untrustedWebRequest> </messaging>
LOG4NET Logs2014-02-01 10:33:18,038 (GMT-6) [14] DEBUG DotNetOpenAuth.Messaging.Channel - Preparing to send AccessTokenRefreshRequest (2.0) message.2014-02-01 10:33:18,038 (GMT-6) [14] INFO DotNetOpenAuth.Messaging.Channel - Prepared outgoing AccessTokenRefreshRequest (2.0) message for https://accounts.google.com/o/oauth2/token: refresh_token: 1/mUT-p67CE1hkns--37Mt-h1N1zZTEecA7zD9xvFGggk grant_type: refresh_token client_id: 544360995449-cpomd50e98cajqf8j6hacobk8t4unq46.apps.googleusercontent.com client_secret: ra9k15dIs-tVDdZqYK6pCnxo
2014-02-01 10:33:18,038 (GMT-6) [14] DEBUG DotNetOpenAuth.Messaging.Channel - Sending AccessTokenRefreshRequest request.2014-02-01 10:33:18,646 (GMT-6) [14] DEBUG DotNetOpenAuth.Http - HTTP POST https://accounts.google.com/o/oauth2/token2014-02-01 10:33:18,740 (GMT-6) [14] DEBUG DotNetOpenAuth.Messaging - The following required parameters were missing from the DotNetOpenAuth.OAuth2.Messages.AccessTokenFailedResponse message: {error,}2014-02-01 10:33:18,740 (GMT-6) [14] WARN DotNetOpenAuth.Messaging - Multiple message types seemed to fit the incoming data: {AccessTokenSuccessResponse (2.0),UnauthorizedResponse (2.0),}
System.InvalidOperationExceptionSequence contains no elements
DotNetOpenAuth.Messaging.ProtocolException: No OpenID endpoint found. ---> System.InvalidOperationException: Sequence contains no elements at System.Linq.Enumerable.First[TSource](IEnumerable`1 source) at DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty.CreateRequest(Identifier userSuppliedIdentifier, Realm realm, Uri returnToUrl) --- End of inner exception stack trace --- at DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty.CreateRequest(Identifier userSuppliedIdentifier, Realm realm, Uri returnToUrl) at DotNetOpenAuth.AspNet.Clients.OpenIdClient.RequestAuthentication(HttpContextBase context, Uri returnUrl) at DotNetOpenAuth.AspNet.OpenAuthSecurityManager.RequestAuthentication(String returnUrl) at UI.Controllers.HomeController.LoginGoogle(RegisterUser model) at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.<>c__DisplayClass2a.<BeginInvokeAction>b__20() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) at System.Web.Mvc.Controller.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) at System.Web.Mvc.MvcHandler.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Error while performing discovery on: "https://www.google.com/accounts/o8/id": DotNetOpenAuth.Messaging.ProtocolException: Error occurred while sending a direct message or getting the response. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
HTTP GET https://www.google.com/accounts/o8/idError in openid popup request authentication, DotNetOpenAuth.Messaging.ProtocolException: No OpenID endpoint found. ---> System.InvalidOperationException: Sequence contains no elements
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)at DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty.CreateRequest(Identifier userSuppliedIdentifier, Realm realm, Uri returnToUrl)--- End of inner exception stack trace ---at DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty.CreateRequest(Identifier userSuppliedIdentifier, Realm realm, Uri returnToUrl)
at Website.Controllers.OpenIdController.GetProviderRequest(OpenIdProvider provider, String platform, Boolean isNewAccount) in c:\src-r\Website\Controllers\OpenIdController.cs:line 152
at DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty.Discover(Identifier identifier)
at DotNetOpenAuth.OpenId.RelyingParty.AuthenticationRequest.Create(Identifier userSuppliedIdentifier, OpenIdRelyingParty relyingParty, Realm realm, Uri returnToUrl, Boolean createNewAssociationsAsNeeded)
To view this discussion on the web visit https://groups.google.com/d/msgid/dotnetopenid/00d78498-447e-4260-975c-faf82078a7ff%40googlegroups.com.--
DotNetOpenAuth Related Links
» Wiki: http://goo.gl/cO58dm
» Code Samples: http://goo.gl/yPeJf4
» Stack Overflow: http://goo.gl/HxvUzV
---
You received this message because you are subscribed to a topic in the Google Groups "DotNetOpenAuth" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dotnetopenid/SWw10f8MI_E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dotnetopenid...@googlegroups.com.
To post to this group, send email to dotnet...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
...at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& <span style=