DotNetOpenAuth 4.3 - 意外的响应Content-Type text / html

时间:2013-06-18 16:18:29

标签: dotnetopenauth

使用OAuthAuthorizationServer和OAuthClient示例,我得到以下内容:

[ProtocolException: Unexpected response Content-Type text/html]
   DotNetOpenAuth.Messaging.ErrorUtilities.VerifyProtocol(Boolean condition, String unformattedMessage, Object[] args) in c:\BuildAgent\work\1e6dbb6a394efdc4\src\DotNetOpenAuth.Core\Messaging\ErrorUtilities.cs:205
   DotNetOpenAuth.Messaging.ErrorUtilities.ThrowProtocol(String unformattedMessage, Object[] args) in c:\BuildAgent\work\1e6dbb6a394efdc4\src\DotNetOpenAuth.Core\Messaging\ErrorUtilities.cs:238
   DotNetOpenAuth.OAuth2.ChannelElements.OAuth2ClientChannel.ReadFromResponseCore(IncomingWebResponse response) in c:\BuildAgent\work\1e6dbb6a394efdc4\src\DotNetOpenAuth.OAuth2.Client\OAuth2\ChannelElements\OAuth2ClientChannel.cs:101
   DotNetOpenAuth.Messaging.Channel.RequestCore(IDirectedProtocolMessage request) in c:\BuildAgent\work\1e6dbb6a394efdc4\src\DotNetOpenAuth.Core\Messaging\Channel.cs:750
   DotNetOpenAuth.Messaging.Channel.Request(IDirectedProtocolMessage requestMessage) in c:\BuildAgent\work\1e6dbb6a394efdc4\src\DotNetOpenAuth.Core\Messaging\Channel.cs:536
   DotNetOpenAuth.OAuth2.ClientBase.UpdateAuthorizationWithResponse(IAuthorizationState authorizationState, EndUserAuthorizationSuccessAuthCodeResponse authorizationSuccess) in c:\BuildAgent\work\1e6dbb6a394efdc4\src\DotNetOpenAuth.OAuth2.Client\OAuth2\ClientBase.cs:341
   DotNetOpenAuth.OAuth2.WebServerClient.ProcessUserAuthorization(HttpRequestBase request) in c:\BuildAgent\work\1e6dbb6a394efdc4\src\DotNetOpenAuth.OAuth2.Client\OAuth2\WebServerClient.cs:164
   OAuthClient._Default.Page_Load(Object sender, EventArgs e) in C:\SourceCode\Damikaa\DotNetAuthPoc\OAuthClient\Default.aspx.cs:37
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.UI.Control.LoadRecursive() +71
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3064

任何人都有任何想法?

2 个答案:

答案 0 :(得分:1)

原因可能来自您为AuthorizationEndpoint和TokenEndpoint提供的网址以及您为获取响应而创建请求的网址。

确保您为这些项目设置了正确的网址。

答案 1 :(得分:0)

看起来像一个有故障的授权服务器。一个未在其响应中正确设置HTTP标头的文件。