Facebook-accounts is dead!

Hi everybody,

Today the Facebook graph API v2.2 was deprecated and the login facebook system is broken.

Do you know how to upgrade the facebook-accounts package to a newer version of the Facebook Graph API?

I created an issue 15 days ago on the Meteor/accounts repo but had no response whatsoever. I also tried to clone the project’s repo and to try to upgrade the API to the lastest version, but couldn’t managed to get it working :frowning:

Link to the issue: https://github.com/meteor/accounts/issues/23

Any help is really apreciated!

3 Likes

hmm… does this mean any old app currently using accounts-facebook is screwed?

Hi @orcprogramming - which version of Meteor are you using? This should have been addressed in 1.4.3 - you can see the commit here:

2 Likes

Hi @hwillson,

Yes, that’s exactly the solution. Many thanks!

I’m running Meteor 1.2, that’s that problem :frowning:

I’m now trying to upgrade to Meteor 1.4 to fix the issue. Of course, that will probably brake some stuff… will see

Thanks for the quick reply :slight_smile:

Probably!

in my case I’m running Meteor 1.2 with the old accounts package

You might be able to clone the new package into your 1.2 project as an override, see here: https://guide.meteor.com/writing-atmosphere-packages.html#overriding-atmosphere-packages

1 Like

Thanks @sashko

I’m now trying to upgrade to Meteor 1.4. In case that doesn’t work, l’ll try your approach :slight_smile:

The upgrade to Meteor 1.4 seems to be fine locally… I now have to deal with mupx and Meteor 1.4 :confused:

1 Like

Move to mup https://github.com/zodern/meteor-up you’ll be much happier :slight_smile:

1 Like

For those facing the same issue, I just created a repo with a patched version of the old facebook (accounts) package to handle facebook graph API v.28:

Let me know if you find any bugs :slight_smile:

5 Likes

Thanks for offering that work-around, @orcprogramming. An official solution is now available for Meteor 1.4.2.x users (Meteor 1.4.3.x were already covered).

For those on Meteor 1.4.2.x, we’ve just published accounts-facebook@1.0.12 with the back-ported fixes (#1 & #2) which we released last month for the 1.4.3.x branch. You can add this to your project without updating to a newer version of Meteor (although we highly recommend you do that as well!) by running:

meteor add accounts-facebook@1.0.12

This will bring your Facebook API up to version 2.8 which is due to be supported until “at least October 2018” by Facebook and solve issues which may have began with the March 27th deprecation of the 2.2 API which was in use in older versions of the Meteor accounts-facebook and facebook packages.

(Again, those using the latest version of Meteor in the 1.4.3.x-series will already have this update with the inclusion of accounts-facebook@1.1.x or facebook-oauth@1.3.0, which were released with Meteor 1.4.3.1.)

3 Likes

Is there any support for Meteor @1.2?

We have no plans to backport the Facebook fix to Meteor 1.2.

Meteor 1.2 is using a version of Node.js (0.10.x) which stopped being supported by Node.js last October. Node.js no longer provides security updates for Node 0.10.x, and by continuing to release updates for it, we would be encouraging its use.

As stated above by @sashko, you may have success cloning the manually fixed package into your packages directory per these instructions.

We would highly recommend you update to Meteor 1.4.

The patch by fede-rodes works for Meteor 1.2.
See: https://github.com/fede-rodes/facebook-accounts-patched

Keep your current install, and simply copy his facebook folder+contents to your packages folder.

3 Likes

Is there any solution for Meteor 1.3.1?

I would upgrade my Meteor 1.2, but I am using FSCollection, and there are loads of incompatibilities with that package. If you could point out a good replacement for an image uploader, including image manipulation (resize, etc.). That would be very helpful. Cheers

Can I upgrade from the latest 1.2 version of meteor to the latest available meteor version without big troubles? Does Meteor 1.4.x support the 1.2 coding styles?

So I am on 1.4.3.2 with facebook-oauth@1.3.0 and accounts-facebook@1.1.1 but attempting to authenticate crashes the server with the following error

(oauth.js:431) Error in OAuth Server: Failed to complete OAuth handshake with Facebook. failed [400] {"error":{"message":"Invalid verification code format.","type":"OAuthException","code":100,"fbtrace_id":"GsGEnKwqM2Q"}}
Exception while invoking method 'login' Error: Failed to complete OAuth handshake with Facebook. failed [400] {"error":{"message":"Invalid verification code format.","type":"OAuthException","code":100,"fbtrace_id":"GsGEnKwqM2Q"}}

Does anybody know how to fix this?

Was it working for you on previous versions or is this your first attempt? I’m not suggesting you directly share the output of this (as it may have sensitive details), but you may get more information about the requests that are being made to Facebook’s server if you run Meteor with the environment variable METEOR_LOG=debug set.

Generally, you can do:

METEOR_LOG=debug meteor <commands as usual> ...

However, there’s a variety of ways to set that depending on your OS and shell, so I’ll only offer complete suggestions on how to do so if you ask and let me know what you’re working with. :wink:

HI,

Last week I updated my app to use all social networks, so the devil is in the small details. below my working code

accounts-google
accounts-facebook
accounts-twitter
accounts-github
jonperl:accounts-linkedin
ServiceConfiguration.configurations.upsert({
    service: "facebook"
}, {
    $set: {
        appId: Meteor.settings.private.facebook.clientId,
        loginStyle: "popup",
        secret: Meteor.settings.private.facebook.secret
    }
});

ServiceConfiguration.configurations.upsert({
    service: "github"
}, {
    $set: {
        clientId: Meteor.settings.private.github.clientId,
        loginStyle: "popup",
        secret: Meteor.settings.private.github.secret
    }
});

// ServiceConfiguration.configurations.remove({
//     service: "github"
// });

// ServiceConfiguration.configurations.remove({
//     service: "facebook"
// });

// "AccountsUiConfig": {
//       "passwordSignupFields": "USERNAME_AND_OPTIONAL_EMAIL",
//       "requestPermissions": {
//         "facebook": [
//           "email",
//           "user_friends",
//           "friends_events",
//           "friends_location",
//           "friends_about_me",
//           "friends_status"
//         ]
//       }


ServiceConfiguration.configurations.remove({
    service: "linkedin"
});
ServiceConfiguration.configurations.insert({
    loginStyle: "popup",
    service: "linkedin",
    clientId: Meteor.settings.private.linkedin.clientId,
    secret: Meteor.settings.private.linkedin.secret,
});

// first, remove configuration entry in case service is already configured
ServiceConfiguration.configurations.remove({
    service: "twitter"
});
ServiceConfiguration.configurations.insert({
    service: "twitter",
    consumerKey: Meteor.settings.private.twitter.clientId,
    loginStyle: "popup",
    secret: Meteor.settings.private.twitter.secret
});

const numberOfUsers = Meteor.users.find().count();
console.log('Checking the user accounts, number of users is: ' + numberOfUsers)

if (!numberOfUsers) {
    var id = Accounts.createUser({
        username: 'demo',
        email: 'demo@qlik.com',
        password: 'schiphol',
        profile: { name: 'Qlik test user' }
    });
    console.log('user created with id: ', id);
    Roles.addUsersToRoles(id, 'test', Roles.GLOBAL_GROUP);

    id = Accounts.createUser({
        username: 'admin',
        email: 'mbj@qlik.com',
        password: 'Qlik456464',
        profile: { name: 'Qlik admin user' }
    });
    console.log('user created with id: ', id);
    Roles.addUsersToRoles(id, 'admin', Roles.GLOBAL_GROUP);
}

ServiceConfiguration.configurations.upsert({
    service: "google"
}, {
    $set: {
        clientId: Meteor.settings.private.google.clientId,
        loginStyle: "popup",
        secret: Meteor.settings.private.google.secret
    }
});
"facebook": {
            "clientId": "1754933311453043",
            "secret": ""
        },
        "twitter": {
            "clientId": "9hpf77dh7BhLgwtGeoELT3CLX",
            "secret": ""
        },
        "linkedin": {
            "clientId": "86rpkry91dn41y",
            "secret": ""
        },
        "github": {
            "clientId": "535d2ca6386eeca90d65",
            "secret": ""
        }
1 Like