开发者

Facebook oAuth 400 Error from ASP.NET application

ASP.NET application performing oAuth with Facebook. This code was working fine until a few days ago and now suddenly throws 400 errors. Cannot seem to find out why - the code has remained unchanged (verified using SVN). Can anyone help with might be the cause?

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.WebException: The remote server returned an error: (400) Bad Request.

Source Error:

Line 231:        {
Line 232:                        
Line 233:            webRequest.GetResponse().GetResponse开发者_高级运维Stream().Close();           
Line 234:            
Line 235:            responseReader.Close();


No. They URLdecode the response BEFORE sending it back to you now. So if you were already decoding it at your server its double decoded and when you send it back to Facebook it throws an invalid token exception.

This was really shitty of facebook. They should have atleast warned the developers.


If anyone finds this page because they are/were getting a 400 error with facebook the problem for me was that my redirect URL ended with a /.

So, for your redirect URL:

http://www.website.com/oauth/callback/ - Bad
http://www.website.com/oauth/callback - Good

I hope that helps someone..

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜