Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

facebook OpenGraph API on Rails (FBGraph)

I am trying to use FBGraph to let my app publish messages on the users wall. However, all of the APIs are kind of foreign to me and I am just trying to change things and see what happens. Right now, I am getting this error message

{
   "error": {
      "type": "OAuthException",
      "message": "Invalid redirect_uri: Given URL is not allowed by the Application configuration."
   }
}

Does anyone know what it means by redirect_uri? What would it be on my Application Settings page on facebook?

like image 315
denniss Avatar asked Aug 19 '10 00:08

denniss


2 Answers

Florin is correct. Just a note here.. when testing locally you will need to set it to:

http://localhost:3000/ (or whatever your app server port is)

Then when you move it to production, set it to your regular URL:

http://yourdomain.com/

I have a separate facebook app that I use in development to test, so I don't have to change back and forth between them and I set up the keys in a settings file, which has my tokens for development and production apps.

Anyways, looks like you are almost there. It is making it back to the callback url at least. Should be fine once you update the facebook_connect URL

like image 51
johnmcaliley Avatar answered Oct 15 '22 18:10

johnmcaliley


I am not a facebook expert, but I hit the exact same problem as you a few hours ago when I was trying to login a user inside a web application with Facebook.

It seems that the redirect_uri which you specify in your call to "https://graph.facebook.com/oauth/authorize" must be on the same domain as the Connect Url of your application. (you can set that connect url from the Connect section in your application's settings)

Regards, Florin

like image 30
Florin Dumitrescu Avatar answered Oct 15 '22 18:10

Florin Dumitrescu