开发者

facebook OpenGraph API on Rails (FBGraph)

开发者 https://www.devze.com 2023-01-11 23:36 出处:网络
I am trying to use FBGraph to let my app publish messages on the users wa开发者_JS百科ll. However, all of the APIs are kind of foreign to me and I am just trying to change things and see what happens.

I am trying to use FBGraph to let my app publish messages on the users wa开发者_JS百科ll. 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?


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


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


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..

0

精彩评论

暂无评论...
验证码 换一张
取 消