"Error validating client secret." 404 with Facebook Oauth and ruby

I've seen that error message many times. Here are the things I would double check:

  • your domain is the same as what you listed in the facebook callback url
  • the app id is correct (actually print this out on a page, sometimes y
  • the app secret is correct

Add redirect_uri while creating the object of facebook that will fix the issue.

Redirect the user to https://www.facebook.com/dialog/oauth?client_id=YOUR_APP_ID&redirect_uri=YOUR_URL After user click allow, it'll hit our Redirect Uri At that point we'll get the code and we need to do a server side HTTP Get to the following Url to exchange the code with our oAuth access token:

https://graph.facebook.com/oauth/access_token? client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&

 client_secret=YOUR_APP_SECRET&code=THE_CODE_FROM_ABOVE

Now at step 3, I kept on getting Http 400 response back.

So after some research, I found out that on that redirect_uri that we submitted on step 3 doesn't do anything but validate the request. Thus, the value need to match with step 2.