Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

facebook login using oauth fails on live server

I'm using OAuthWebSecurity to login with facebook and it is working on localhost. However then deployed to the live server I get the following error message:

The remote server returned an error: (400) Bad Request.

  • I have checked domain details are correct on facebook.
  • The sandbox mode is disabled.
  • I have disabled windows firewall - still get same error.
  • Responses from facebook have the identical format whether in live or localhost environments.
  • The date and time of live server is correct.

I've test locally also changing the host file to the live domain - still works locally.

Here's the stack trace:

[WebException: The remote server returned an error: (400) Bad Request.]
System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request) +3291120
System.Net.WebClient.DownloadString(Uri address) +207
DotNetOpenAuth.AspNet.Clients.FacebookClient.QueryAccessToken(Uri returnUrl, String authorizationCode) +293
DotNetOpenAuth.AspNet.Clients.OAuth2Client.VerifyAuthentication(HttpContextBase context, Uri returnPageUrl) +167
DotNetOpenAuth.AspNet.OpenAuthSecurityManager.VerifyAuthentication(String returnUrl) +502
Microsoft.Web.WebPages.OAuth.OAuthWebSecurity.VerifyAuthenticationCore(HttpContextBase context, String returnUrl) +231

Any suggestions?

like image 944
Andrew Avatar asked Nov 03 '22 23:11

Andrew


1 Answers

There was a defect open related to this: https://github.com/DotNetOpenAuth/DotNetOpenAuth/issues/203

but that library is apparently no longer being maintained: https://github.com/DotNetOpenAuth/DotNetOpenAuth/issues/317#issuecomment-29580565

... although it is still referenced in many Microsoft documents. Investigating that related to another defect.

See also: The remote server returned an error: (400) Bad Request Microsoft.AspNet.Membership.OpenAuth

like image 130
shannon Avatar answered Nov 08 '22 05:11

shannon