Check if facebook oauth 2.0 october 1st migration is done - facebook

I'm using facebook connect on a website, it worked well with PHP SDK 3.0.1.
Now I've downloaded and started using PHP SDK v.3.1.1 and set Encrypted Access Token to enabled. It still works without problems. Is this enough for the migration? How can I check it? I don't use the js sdk.

According to the migration guide, it looks like you have done all the steps you need for Facebook on an external website by upgrading to 3.1.1 PHP SDK and set encrypted access token.
If you were hosting a fan page or app inside Facebook you would also need an SSL certificate. And there are several code changes required if you are using the javascript SDK which you say you aren't.

Related

Cant test FB SDK login locally even though I have set my domain and site URL (app is test mode)

I am developing a web app with Facebook integration and I can't figure out why I can't test the login function locally. I have looked through the answers here (How to Test Facebook Connect Locally) and have tried to follow the steps of having the app in test mode, setting the site URL and the domain.
Based on FBs documentation here: https://developers.facebook.com/blog/post/2018/06/08/enforce-https-facebook-login/
I should be able to use http for localhost development, but I get the error
The method FB.api can no longer be called from http pages. https://developers.facebook.com/blog/post/2018/06/08/enforce-https-facebook-login/
and can't log in. Below are pictures of my app settings (including an indication it is an app in 'test mode').
So this is really only a half answer, but it seemed easier for me to just force https for my local development using mkcert (https://github.com/FiloSottile/mkcert). After creating local certs I updated my site URL to say https://localhost:8080 and I am able to log in without issue.

Grails Facebook-Graph Plugin Oauth2

We have been using the Grails Facebook-graph plugin for a while now - it has been working perfectly until earlier this month when FB apparently turned off their old authentication scheme, and indirectly forced everybody to use oauth2 instead.
This post from FB https://developers.facebook.com/blog/post/525/ describes the changes, and the issue in the Grails plugin seems to be that it does not comply with the new standard.
The main issue appears to be in the way the active user data is being maintained in the plugin. This is currently based on the FB provided cookie "fbs", which contains all the necessary session data related to the active user. Unfortunately, this is no longer provided by FB (apparently replaced by a "fbsr" cookie instead).
I have searched the FB documentation, and in various forums for details on how to upgrade the plugin, but unfortunately without luck.
Can anyone help with a hint or two on what steps should be performed in order to get the plugin updated?
EDIT: I think the updated version of the plugin (0.14) has been pushed the public repository. You should try grabbing that one first before reading the rest of my answer.
It looks like the plugin maintainer, Jesus Lanchas, made some updates over the last few days to enable oauth2 support. It has not been pushed to the plugin repository yet, but I was able to get it working with my project. Here's what I did:
#Install a local copy of the plugin WITHIN my project
mkdir plugins-local
cd plugins-local
git clone git://github.com/chechu/grails-facebook-graph.git
mv grails-facebook-graph facebook-graph
Update BuildConfig.groovy and tell grails where to load the plugin from. I put this line before grails.project.dependency.resolution
grails.plugin.location.'facebook-graph' = "plugins-local/facebook-graph"
Uninstall the existing facebook-graph plugin from my project
grails uninstall-plugin facebook graph
This is a temporary solution for me until the offical update hits the repo, but it allows me to make sure I'm using the same new code everywhere.
EDIT: we released our Facebook Grails SDK on GitHub :
https://github.com/benorama/facebook-grails-sdk.
Currently only tested on Grails 2.0…
Any feedback is welcome before we release it officially to Grails.org.
Indeed, it looks like Grails Facebook-graph plugin does not support OAuth2 Facebook authentication (which is required since October 1st 2011).
We have already ported the official PHP SDK V3.1.1 to ColdFusion 9 (https://github.com/affinitiz/facebook-cf-sdk).
Last month, we started to implement it as a plugin in Grails 2.0.
It is currently at an alpha stage so we have not released it yet, but it is working on our prototype.
To connect to the Facebook Graph API, it uses RestFB internally.
If you want to give it a try and give us some feedbacks, let me know, I'll sent it to you by email.

JavaScript authentication with c# sdk. What happens on server?

I have made a JS authentication on local server, and it also went fluently on server side. As I understood the sdk cached up with the JS auth and all went well. But When I have uploaded this on server, the IsAuthorized method returned false after the JS auth. Why could that happend? And how does the sdk handle the JS auth?
Check your website url in the facebook app configuration page. Maybe the domain is now different?

how to test develop facebook app with google app engine on local machine

Is it possible to develop facebook using google app engine locally, without having to upload application every time I change it?
I assume you are getting API error 191 when you try to access the Facebook API from the dev appserver?
API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: redirect_uri is not owned by the application.
If you are developing on your localhost, you can set the 'Site Domain' field in your facebook app settings to (appname).appspot.com and then edit the HOSTS file on your system.
In my environment I just entered:
127.0.0.1 devlocal.(appname).appspot.com
As long as the browser's URL matches *.(appname).appspot.com, it will work.
You could set the Website field in your Facebook app settings to http://localhost:XXXX or http://127.0.0.1:XXXX for development and then change it over to the actual once ready for deployment. This worked well for me.
I ran into this issue a couple years ago and wrote a long article about how I solved it for my needs.
http://www.upwithabang.com/articles/GAE-facebook-win7.html
It covers the setting up of an Apache server on your laptop then telling Facebook and the GAE to behave as if it hosted on a production server. This solves the pain of constant uploads for testing every little change.
Hopefully this is helpful to someone, if not a little late.

Login with Facebook via Rails

As a relative newbie to Rails, I'm not sure how to approach this. I am looking to add a basic "Login with Facebook" feature to a practice site I am developing. I am stuck on two fronts:
Most Rails plugins dealing with Facebook seem out of date or poorly documented. I've encountered Facebooker (seems to have died off from what I see) and Mini_FB (more recent, but very little documentation). I tried to install Mini_FB, but I am still very unfamiliar about working with Gems. I ran gem install mini_fb, then bundle install, and finally added gem 'mini_fb' to my Gemfile, but my server complains of a no such file to load error. Are there any other steps necessary to allow your app to use a gem?
I am confused by how the "Login with Facebook" feature works from an overall birds-eye view. I understand that my App ID is passed into the login feature, and I ultimately get an access token (after resubmitting with my App Secret Key and an authorization code). But how does this integrate with some kind of user system on a Rails site? Since this access code doesn't last forever, do I need to renew it periodically? Is that done by simply waiting to catch an access token error from a Graph request and redoing the entire authorization procedure?
Have you tried OmniAuth?
It supports a whole host of external providers, including facebook.
There are also a number of railscasts on it's use.
The correct order of installing a gem on your application would be first adding it to your Gemfile.rb, then running bundle install on your console. That being said, OmniAuth is probably the best path for you