2

使用 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

有人有想法么?

4

2 回答 2

1

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

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

于 2013-12-17T05:29:06.650 回答
0

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

于 2013-06-20T14:35:27.657 回答