Send Data Using the WebRequest Class to DotNetOpenAuth website

Posted by Denis on Stack Overflow See other posts from Stack Overflow or by Denis
Published on 2010-03-05T14:46:31Z Indexed on 2010/03/08 9:36 UTC
Read the original article Hit count: 585

Filed under:
|

I am trying to send data to DotNetOpenAuth website as described here http://msdn.microsoft.com/en-us/library/debx8sh9.aspx Sender receive (500) Internal Server Error. The same code for blank website without DotNetOpenAuth works fine. Should I tweak something?

Here is an exception:

System.ArgumentNullException was unhandled by user code
  Message="Value cannot be null.\r\nParameter name: key"
  Source="mscorlib"
  ParamName="key"
  StackTrace:
       at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
       at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
       at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
       at DotNetOpenAuth.OAuth.ChannelElements.OAuthChannel.ReadFromRequestCore(HttpRequestInfo request) in c:\BuildAgent\work\7ab20c0d948e028f\src\DotNetOpenAuth\OAuth\ChannelElements\OAuthChannel.cs:line 145
       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

Exception occurs on last line of the code:

    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));

© Stack Overflow or respective owner

Related posts about dotnetopenauth

Related posts about ASP.NET