Error using Facebook login with Parse Server

I am one of many users who port Parse to Heroku (with the MongoLab sandbox), using https://parse.com/docs/server/guide as a guide.

Everything was fine with the migration (objects can be created / retrieved using REST commands on the remote repo) until I try to use (iOS) Facebook.

Method:

[PFFacebookUtils logInInBackgroundWithReadPermissions: ... ] 

which worked when hosting Parse now returns the following error:

 [Error]: Facebook auth is invalid for this user. (Code: 101, Version: 1.12.0) 

Note. The only change for my (previously working) iOS code is to point the Parse server to my new manually supported repository, as shown below:

  let parseConfiguration = ParseClientConfiguration(block: { (ParseMutableClientConfiguration) -> Void in ParseMutableClientConfiguration.applicationId = "<*APP ID*>" ParseMutableClientConfiguration.clientKey = "<*CLIENT KEY*>" ParseMutableClientConfiguration.server = "https://<*HEROKU APP ID*>.herokuapp.com/parse" }) Parse.initializeWithConfiguration(parseConfiguration) 

& the only open-source Parse server code modification ( https://github.com/ParsePlatform/parse-server-example ) replaces the configuration according to my Parse / mongo identity:

 var api = new ParseServer({ databaseURI: 'mongodb://<*UNIUQUE ID*>' || 'mongodb://localhost:27017/dev', cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js', appId: '<*PARSE APP ID*>', masterKey: '<*PARSE MASTER KEY*>' }); 
+7
ios facebook mongodb heroku parse-server
source share
3 answers

you need to add the facebookAppIds key, which contains an array of valid facebook application identifiers, as mentioned in the docs here .

add the FACEBOOK_APP_ID key as a link [here] ( https://github.com/ParsePlatform/parse-server/issues/82 )

+8
source share

I don’t know if you have already tried it or already, but I was in a very similar situation, since you and what was fixed for me were as follows:

In AppDelegate.swift , the ParseClientConfiguration must be initialized BEFORE initializing the Parse Facebook Utils in didFinishLaunchingWithOptions :

 ... // *** Initialize Parse. *** let config = ParseClientConfiguration(block: { (ParseMutableClientConfiguration) -> Void in ParseMutableClientConfiguration.applicationId = appKey; ParseMutableClientConfiguration.clientKey = clientKey; ParseMutableClientConfiguration.server = serverURL; }); Parse.initializeWithConfiguration(config); // *NOTE: Putting the following line after after Parse.initializeWithConfiguration(config) fixed the issue // After this change, the user is no longer nil and does not print "Uh oh. The user cancelled the Facebook login.". Instead, it executes the `if let user = user` block PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions) ... 

Hope this helps at least someone!

+3
source share

I had the same issue on Parse Server running in Back4app. The solution was to add the Facebook app ID on the Back4app platform.

0
source share

All Articles