开发者

How do I debug a 400 Bad Request error with DotNetOpenAuth?

I'm using DotNetOpenAuth to connect to the LinkedIn API. I am getting a (400) Bad Request when trying to call the BeginAuthorize method in their API. What am I doing wrong? I'm using Win开发者_如何学JAVAdows 7 and the firewall is disabled.


even i have faced the same problem. this one is not related to windows 7 security policy. the Date & time (local system) is not matched with your linked-in API (server).

Debug your code and gothru the inner details of the exception..

By Installing Network Time Protocol in your system would solve the problem

Thanks, Gunasekaran Sambandhan


When you get a 400 BadRequest, there's always more information. To get that information, you have to enable logging in DotNetOpenAuth. Here are a few things to make sure of:

  1. Make sure your log4net is bin deployed (copied to the bin directory where your program resides. Setting 'Copy Local' to true in Visual Studio will do this for you.

The 'bad request' (with complete information) will show up in wherever you have logging set up for Log4net. Here's an example of what it looks like to set up Log4Net.


Normally Bad request error happen because of security reasons like:

  1. Firewall
  2. Query string length it

Try disabling the IP Security policies in Windows 7 and see if that fixes the issue.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜