DotNetOpenAuth 与 Yahoo、AOL 导致超时或 NameResolutionFailure
我正在使用 DotNetOpenAuth 3.5.0.10357,并且在尝试授权使用 Yahoo 作为提供商 (https://me.yahoo.com) 时,经常在 OpenIdRelyingParty.CreateRequest(Identifier) 处抛出 ProtocolException。如果在第一次尝试后立即进行另一次尝试,工作流将按预期运行。我已按照 this< 添加了 XRDS 文档/a> 博客文章,当雅虎提供商响应时,它似乎检测到该文件,因为它不再显示该验证消息。除 AOL 存在相同问题外,所有其他提供商均始终正常工作。我启用了日志记录,似乎有两个不同的原因,一个是超时,另一个是 NameResolutionFailure,两者都来自 WebException。
以下是导致 NameResolutionFailure 的实例的日志:
HTTP GET https://me.yahoo.com/ 来自 WebException NameResolutionFailure https://me.yahoo.com/,没有可用的回复。执行时出错 发现:“https://me.yahoo.com/”: DotNetOpenAuth.Messaging.ProtocolException:发生错误 发送直接消息或获取回复。 ---> System.Net.WebException:无法解析远程名称: 'me.yahoo.com' 在 System.Net.HttpWebRequest.GetResponse() 处 DotNetOpenAuth.Messaging.StandardWebRequestHandler.GetResponse(HttpWebRequest request, DirectWebRequestOptions options) --- 内部结束 异常堆栈跟踪 --- at DotNetOpenAuth.Messaging.StandardWebRequestHandler.GetResponse(HttpWebRequest 请求,DirectWebRequestOptions 选项)位于 DotNetOpenAuth.Messaging.UntrustedWebRequestHandler.GetResponse(HttpWebRequest 请求,DirectWebRequestOptions 选项)位于 DotNetOpenAuth.Yadis.Yadis.Request(IDirectWebRequestHandler requestHandler、Uri uri、布尔 requireSsl、String[] AcceptTypes)
在 DotNetOpenAuth.Yadis.Yadis.Discover (IDirectWebRequestHandler requestHandler、UriIdentifier uri、布尔值 requireSsl) at DotNetOpenAuth.OpenId.UriDiscoveryService.Discover(标识符 标识符、IDirectWebRequestHandler requestHandler、Boolean& 中止发现链) DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty.Discover(标识符 标识符)在 DotNetOpenAuth.OpenId.RelyingParty.AuthenticationRequest.Create(标识符 userSuppliedIdentifier、OpenIdRelyingParty retingParty、Realm 领域、 Uri returnToUrl, Boolean createNewAssociationsAsNeeded) 执行 用户提供的标识符的发现:https://me.yahoo.com/ 过滤 并且端点的排序不会影响列表。
以下是超时的日志:
HTTP GET https://me.yahoo.com/ WebException 超时 https://me.yahoo.com/,没有可用的回复。执行时出错 发现:“https://me.yahoo.com/”: DotNetOpenAuth.Messaging.ProtocolException:发生错误 发送直接消息或获取回复。 ---> System.Net.WebException:操作已超时 System.Net.HttpWebRequest.GetResponse() 位于 DotNetOpenAuth.Messaging.StandardWebRequestHandler.GetResponse(HttpWebRequest request, DirectWebRequestOptions options) --- 内部结束 异常堆栈跟踪 --- at DotNetOpenAuth.Messaging.StandardWebRequestHandler.GetResponse(HttpWebRequest 请求,DirectWebRequestOptions 选项)位于 DotNetOpenAuth.Messaging.UntrustedWebRequestHandler.GetResponse(HttpWebRequest 请求,DirectWebRequestOptions 选项)位于 DotNetOpenAuth.Yadis.Yadis.Request(IDirectWebRequestHandler requestHandler、Uri uri、布尔 requireSsl、String[] AcceptTypes)
在DotNetOpenAuth.Yadis.Yadis.Discover(IDirectWebRequestHandler requestHandler、UriIdentifier uri、布尔值 requireSsl) at DotNetOpenAuth.OpenId.UriDiscoveryService.Discover(标识符 标识符、IDirectWebRequestHandler requestHandler、Boolean& 中止发现链) DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty.Discover(标识符 标识符)在 DotNetOpenAuth.OpenId.RelyingParty.AuthenticationRequest.Create(标识符 userSuppliedIdentifier、OpenIdRelyingParty retingParty、Realm 领域、 Uri returnToUrl, Boolean createNewAssociationsAsNeeded) 执行 用户提供的标识符的发现:https://me.yahoo.com/ 过滤 并且端点的排序不会影响列表。
我正在使用默认配置设置。我猜想我可以通过增加超时设置来解决超时错误,但是我不确定如何解决名称解析错误。
I'm using DotNetOpenAuth 3.5.0.10357 and when attempting to authorize using Yahoo as the provider (https://me.yahoo.com) often times a ProtocolException is thrown at OpenIdRelyingParty.CreateRequest(Identifier). If another attempt is made immediately after the first attempt, the workflow behaves as expected. I've added a XRDS document as per this blog post and when the Yahoo provider responds it seems to detect the file as it no longer displays that verification message. All other providers, with the exception of AOL which has the same issues, work properly at all times. I've enabled logging and there seem to be two different causes, one is a timeout another is a NameResolutionFailure, both from WebException.
Here is the log from the instance resulting in NameResolutionFailure:
HTTP GET https://me.yahoo.com/ WebException NameResolutionFailure from
https://me.yahoo.com/, no response available. Error while performing
discovery on: "https://me.yahoo.com/":
DotNetOpenAuth.Messaging.ProtocolException: Error occurred while
sending a direct message or getting the response. --->
System.Net.WebException: The remote name could not be resolved:
'me.yahoo.com' at System.Net.HttpWebRequest.GetResponse() at
DotNetOpenAuth.Messaging.StandardWebRequestHandler.GetResponse(HttpWebRequest
request, DirectWebRequestOptions options) --- End of inner
exception stack trace --- at
DotNetOpenAuth.Messaging.StandardWebRequestHandler.GetResponse(HttpWebRequest
request, DirectWebRequestOptions options) at
DotNetOpenAuth.Messaging.UntrustedWebRequestHandler.GetResponse(HttpWebRequest
request, DirectWebRequestOptions options) at
DotNetOpenAuth.Yadis.Yadis.Request(IDirectWebRequestHandler
requestHandler, Uri uri, Boolean requireSsl, String[] acceptTypes)
at DotNetOpenAuth.Yadis.Yadis.Discover(IDirectWebRequestHandler
requestHandler, UriIdentifier uri, Boolean requireSsl) at
DotNetOpenAuth.OpenId.UriDiscoveryService.Discover(Identifier
identifier, IDirectWebRequestHandler requestHandler, Boolean&
abortDiscoveryChain) at
DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty.Discover(Identifier
identifier) at
DotNetOpenAuth.OpenId.RelyingParty.AuthenticationRequest.Create(Identifier
userSuppliedIdentifier, OpenIdRelyingParty relyingParty, Realm realm,
Uri returnToUrl, Boolean createNewAssociationsAsNeeded) Performing
discovery on user-supplied identifier: https://me.yahoo.com/ Filtering
and sorting of endpoints did not affect the list.
The following is the log from a timeout:
HTTP GET https://me.yahoo.com/ WebException Timeout from
https://me.yahoo.com/, no response available. Error while performing
discovery on: "https://me.yahoo.com/":
DotNetOpenAuth.Messaging.ProtocolException: Error occurred while
sending a direct message or getting the response. --->
System.Net.WebException: The operation has timed out at
System.Net.HttpWebRequest.GetResponse() at
DotNetOpenAuth.Messaging.StandardWebRequestHandler.GetResponse(HttpWebRequest
request, DirectWebRequestOptions options) --- End of inner
exception stack trace --- at
DotNetOpenAuth.Messaging.StandardWebRequestHandler.GetResponse(HttpWebRequest
request, DirectWebRequestOptions options) at
DotNetOpenAuth.Messaging.UntrustedWebRequestHandler.GetResponse(HttpWebRequest
request, DirectWebRequestOptions options) at
DotNetOpenAuth.Yadis.Yadis.Request(IDirectWebRequestHandler
requestHandler, Uri uri, Boolean requireSsl, String[] acceptTypes)
at DotNetOpenAuth.Yadis.Yadis.Discover(IDirectWebRequestHandler
requestHandler, UriIdentifier uri, Boolean requireSsl) at
DotNetOpenAuth.OpenId.UriDiscoveryService.Discover(Identifier
identifier, IDirectWebRequestHandler requestHandler, Boolean&
abortDiscoveryChain) at
DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty.Discover(Identifier
identifier) at
DotNetOpenAuth.OpenId.RelyingParty.AuthenticationRequest.Create(Identifier
userSuppliedIdentifier, OpenIdRelyingParty relyingParty, Realm realm,
Uri returnToUrl, Boolean createNewAssociationsAsNeeded) Performing
discovery on user-supplied identifier: https://me.yahoo.com/ Filtering
and sorting of endpoints did not affect the list.
I'm using the default configuration settings. I'm guessing I cat get around the timeout error by increasing the timeout setting, however I'm not sure how to go about the name resolution error.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从例外情况来看,这对我来说看起来不像是 DotNetOpenAuth 特定的问题。您的 DNS 服务器似乎很慢或者您与它的连接状况不佳。我会调查这个问题。是的,增加超时时间会在紧要关头对你有所帮助。
From the exception this doesn't look like a DotNetOpenAuth-specific problem to me. It looks like your DNS server is slow or you have a bad connection to it. I'd look into that problem. And yes, increasing the timeout will help you in a pinch.