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?

Answers


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


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


May need to check your Settings > Basic > Basic Info > App Domain. I believe hat needs to be set correctly for the redirect_uri as well.


I had the same issue.

In my case, I had configured site url on facebook as: "http://localhost:3000", it was a wrong URL to facebook.

The reason is, it lack of the / in the end of url, so the correct site url should be: "http://localhost:3000/"


Just verify your 'Application ID'. In my case I had that problem because I was using ID from my other project that I was working on. Fairly obvious but I lost some time.


I had to make sure I had the scope in there too:

config.omniauth :facebook, 'xxxx', 'xxx', :scope => 'offline_access,email,publish_stream'

Plus you really need to make sure you wait a couple of minutes because it does take time to propagate..


Need Your Help

ios - Spritekit - How to calculate the distance between two nodes?

ios sprite-kit

I have two sknodes on the screen. What is the best way to calculate the distance ('as the crow flies' type of distance, I don't need a vector etc)?

Animate the keyboard in sync with the UIView while edge-swiping back in iOS7

ios iphone ios7 keyboard gesture

I'd like to get the behavior similar to Messages app (also common in most texting apps) in iOS7, where in a conversation view swiping right from the left edge of the screen would behave like the back