Facebook OAuth access_token return HTTP 400 Error Validating Verification Code
{
"error": {
"type": "OAuthException",
"message": "Error validating verification code."
}
}
I was following the guides at Facebook Developers to do OAuth on the server side. In summary:
- 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.
Finally! Phew.
I've seen this fucking expample for about 1000 times. Please send me something else. How to authenticate, get access_tocken and send message to wall?
This post was a really life saver. I spent the last 2 days trying to understando why it wasn't working! :D
glad that I could help
Thanks Dude!!! It saved ma day ;)
Thanks man :)
Thanks a lot man :-)
Thanks a lot!! =D
Ok, i have to tell thank you, because this f*cking facebook api make me crazy for such a little problem ... Thanks man !
Thanks!
You have saved countless lives.
Thanks a lot, you saved my day!