pablobarbera / Rfacebook

Dev version of Rfacebook package: Access to Facebook API via R
http://cran.r-project.org/web/packages/Rfacebook
350 stars 250 forks source link

Error in fbOAuth() #170

Open leo-filgueira opened 6 years ago

leo-filgueira commented 6 years ago

I'm trying to use the package but I prefer not to use a temporary access. To do this, I'd have to use fbOAuth() function. I've followed the steps at : I've created the app and put the url http://localhost:1410/. When I press Enter in R Console, a window opens with this message:

When I press Ok, this message is printed:

Authentication complete. Please close this page and return to R.

But, in R, the console prints: 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.

Is this a Facebook API problem? The solution is just use the temporary access? Thanks

adrauc commented 6 years ago

Yes, Facebook had some changes. Can be fixed: -Go to the dashboard of your app -left: click on "Facebook Login" -> Settings -Now paste in the field "Valid OAuth redirect URIs" http://localhost:1410/ - save changes -fbOAuth() should now work again in R again

orcololo commented 6 years ago

Can't get token too. It says: "Insecure Login Blocked: You can't get an access token or log in to this app from an insecure page. Try re-loading the page as https://" any fix?

hauteville86 commented 6 years ago

I have received exactly the same message when I tried to connect with fbOAuth. Perhaps the reason is the "Enforce HTTPS for OAuth Redirects and SDK APIs" option in Facebook Login Settings, which cannot be disabled.

According to the Facebook help (https://developers.facebook.com/docs/facebook-login/security): This setting requires HTTPS for OAuth Redirects and pages getting access tokens with the JavaScript SDK. All new apps created as of March 2018 have this setting on by default and you should plan to migrate any existing apps to use only HTTPS URLs by March 2019.

lucsulla commented 6 years ago

Same issue. I believe it has to do with http://localhost:1410/ not being an https:// address. I can't even save it as a valid Oauth redirect it would seem.

jmanuoz commented 6 years ago

Same problem, how can i change redirect rfacebook url on login?

Avee692 commented 6 years ago

did any of you guys come right?

jmanuoz commented 6 years ago

It is only possible with application created before march 2018 and that have recently used. Without that you have to login with ssl localhost with httr and is not so simple

2018-04-19 7:19 GMT-03:00 Avee692 notifications@github.com:

did any of you guys come right?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pablobarbera/Rfacebook/issues/170#issuecomment-382685105, or mute the thread https://github.com/notifications/unsubscribe-auth/AIIVXIm3S-RjqpXZpRZ_tsHMKKm0tYBDks5tqGTLgaJpZM4SAoow .

truongnmt commented 6 years ago

You could create a simple https for localhost as in here: https://stackoverflow.com/a/49363740/3280050

devktpx commented 6 years ago

I have exactly the same problem as @leo-filgueira . @truongnmt suggested link sounds promising. Has anyone tried this solution? Has anyone found a simpler solution in the mean time?

microsoftjulius commented 6 years ago

its still the same issue with me

truongnmt commented 6 years ago

Hey today I check my app in facebook and I see option to disable Enforce HTTPS for OAuth Redirects and SDK APIs. So things work again on localhost.

bryn-g commented 6 years ago

Developer News: Requiring HTTPS for Facebook Login (2018-06-08)

This facebook post also states that:

You will still be able to use HTTP with “localhost” addresses, but only while your app is still in development mode.

Can anyone confirm that with Enforce HTTPS set to NO and the app set to development mode that HTTP authentication works again for old and new apps?

OrikH commented 5 years ago

hi, it writes: HTTPS is required for all Redirect URIs. -when I paste : http://localhost:1410/ Who know what should I do? I am using it for text analysis in R. Thanks in advance

abdelkrk commented 2 years ago

has anyone found a solution ? i am stuck y'all