1

すばらしいDotNetOpenAuthプロジェクトを自分のサイトに添付した後、以下のような未処理の例外がたくさんあります。これを手伝ってくれませんか。

Event message: An unhandled exception has occurred.
Event time: 1/9/2010 5:59:04 AM
Event time (UTC): 1/9/2010 11:59:04 AM
Event ID: fa8b51280ff94c52b24658def6e0a530
Event sequence: 9
Event occurrence: 1
Event detail code: 0

Process information:
   Process ID: 3568
   Process name: w3wp.exe
   Account name: NT AUTHORITY\NETWORK SERVICE

Exception information:
   Exception type: System.ArgumentException
   Exception message: The HTTP verb 'HEAD' is unrecognized and unsupported.
Parameter name: httpVerb

Request information:
   Request URL: http://www.amiproject.com/
   Request path: /
   User host address: xxx.xxx.xxx.xxx
   User:
   Is authenticated: False
   Authentication Type:
   Thread account name: NT AUTHORITY\NETWORK SERVICE

Thread information:
   Thread ID: 8
   Thread account name: NT AUTHORITY\NETWORK SERVICE
   Is impersonating: False
   Stack trace:    at DotNetOpenAuth.Messaging.ErrorUtilities.ThrowArgumentNamed(String parameterName, String message, Object[] args) in c:\BuildAgent\work\7ab20c0d948e028f\src\DotNetOpenAuth\Messaging\ErrorUtilities.cs:line 321
  at DotNetOpenAuth.Messaging.MessagingUtilities.GetHttpDeliveryMethod(String httpVerb) in c:\BuildAgent\work\7ab20c0d948e028f\src\DotNetOpenAuth\Messaging\MessagingUtilities.cs:line 663
  at DotNetOpenAuth.Messaging.MessagingUtilities.GetRecipient(HttpRequestInfo request) in c:\BuildAgent\work\7ab20c0d948e028f\src\DotNetOpenAuth\Messaging\MessagingUtilities.cs:line 647
  at DotNetOpenAuth.OAuth.ChannelElements.OAuthChannel.ReadFromRequestCore(HttpRequestInfo request) in c:\BuildAgent\work\7ab20c0d948e028f\src\DotNetOpenAuth\OAuth\ChannelElements\OAuthChannel.cs:line 150
  at DotNetOpenAuth.Messaging.Channel.ReadFromRequest(HttpRequestInfo httpRequest) in c:\BuildAgent\work\7ab20c0d948e028f\src\DotNetOpenAuth\Messaging\Channel.cs:line 372
  at DotNetOpenAuth.OAuth.ServiceProvider.ReadRequest(HttpRequestInfo request) in c:\BuildAgent\work\7ab20c0d948e028f\src\DotNetOpenAuth\OAuth\ServiceProvider.cs:line 222
  at RelyingPartyLogic.OAuthAuthenticationModule.context_AuthenticateRequest(Object sender, EventArgs e) in C:\My Data\Project\AmiProject Source\RelyingPartyLogic\OAuthAuthenticationModule.cs:line 60
  at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
  at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


---------------
4

1 に答える 1

2

バグを見つけました。ありがとう。私はそれを提出しました

それまでの間、RelyingPartyLogicOAuthAuthenticationModule.csファイルのcontext_AuthenticateRequestメソッドを次のように変更することで回避できます。

private void context_AuthenticateRequest(object sender, EventArgs e) {
    // Don't read OAuth messages directed at the OAuth controller or else we'll fail nonce checks.
    if (this.IsOAuthControllerRequest()) {
        return;
    }

    if (HttpContext.Current.Request.HttpMethod != "HEAD") { // workaround: avoid involving OAuth for HEAD requests.
        IDirectedProtocolMessage incomingMessage = OAuthServiceProvider.ServiceProvider.ReadRequest(new HttpRequestInfo(this.application.Context.Request));
        var authorization = incomingMessage as AccessProtectedResourceRequest;
        if (authorization != null) {
            this.application.Context.User = OAuthServiceProvider.ServiceProvider.CreatePrincipal(authorization);
        }
    }
}
于 2010-01-13T03:40:29.117 に答える