Search code examples
rfacebookrfacebook

Issue installing R facebook HTTP 400


I am trying to install the facebook API with R. I have seen that a few people were also having trouble but I did not find the same issues than me. I have gotten the library but when I use the function fb_oauth <- fbOAuth(... and after putting the URL on Facebook App Settings: http://localhost:1410/, I press enter and get the following message on the facebook page :

"Can't Load URL: The domain of this URL isn't included in the app's domains. To be able to load this URL, add all domains and subdomains of your app to the App Domains field in your app settings."

And on R :

Authentication complete.
Error in oauth2.0_access_token(endpoint, app, code = code, user_params = 
user_params,  : 
  Bad Request (HTTP 400). Failed to get an access token.

I have tried several things but nothing seems to have worked. Maybe I made a mistake when putting the URL but then I don't know where else I should put it...

For the fb_oauth I have tried both with extended_permissions False and True and for app_id and app_secret I have used the info of the page : screen shot

For the URL I have clicked on settings > Add Platform > Website > and then copied the URL second screenshot

I really need this to work so I would appreciate so much if you could help me


Solution

  • I have finally found how to fix the problem myself !

    Just needed to create a Facebook login with the correct URl and it worked ! Adding a platform is not sufficient.