parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

Unable to login with Facebook

Open mkpazon opened this issue 10 years ago • 32 comments

I keep on getting the following response when trying to login with Facebook {code: 101, error: "Facebook auth is invalid for this user."}

Pointing to the parse.com hosted parse-server, everything works. Switching to my local parse-server does not work.

I am currently using Android for my app.

mkpazon avatar Jan 30 '16 15:01 mkpazon

Same thing. Related to #49 and #81.

francocorreasosa avatar Jan 30 '16 19:01 francocorreasosa

Did you set the FACEBOOK_APP_ID environment variable?

gfosco avatar Jan 30 '16 20:01 gfosco

Hi, you need to set the FACEBOOK_APP_ID Like this : heroku config:set FACEBOOK_APP_ID=*********

moana2 avatar Jan 30 '16 21:01 moana2

then it is

export FACEBOOK_APP_ID=*****

gfosco avatar Jan 30 '16 21:01 gfosco

@gfosco can I pass the FB app ID as a ParseServer parameter? I use more than one app in the server.

francocorreasosa avatar Jan 30 '16 22:01 francocorreasosa

I made a change here in #86..

gfosco avatar Jan 30 '16 23:01 gfosco

Merged, will tag a new release shortly

gfosco avatar Jan 30 '16 23:01 gfosco

Getting a appIds.contains is not a function

Changing facebook.js contains to indexOf seems to work

if (data && appIds.indexOf(data.id) != -1) { return; }

mkpazon avatar Jan 31 '16 00:01 mkpazon

Ok, made that change and tagged 2.0.3

gfosco avatar Jan 31 '16 01:01 gfosco

Great @gfosco. Made my day

francocorreasosa avatar Jan 31 '16 02:01 francocorreasosa

I have latest SDK and parse server locally installed. Facebook authentication was not configured during first parse server installation. Subsequently I am added Facebook authentication by adding following in new ParseServer block in app.js oauth: { facebook: { appIds: '35594027127xxxx' }}

I am using for IOS app.

I got error {code: 101, error: "Facebook auth is invalid for this user."}.

However when pointing to hosted parse server everything works fine.

facebook.js seems to be ok as per earlier post

sdalai avatar Feb 29 '16 06:02 sdalai

To @sdalai, circa v2.1.6, check that the class level permissions on _User are all set to allowed (for me I had field creation turned off). Also for your appIds param, try removing the quotes so it is a real number.

rsweny avatar Mar 16 '16 18:03 rsweny

@rsweny How do you change class level permissions?

AlecKriebel avatar Apr 02 '16 03:04 AlecKriebel

In the Parse dashboard "Core" section click on the Security button in the top row. From that screen there is also an advanced toggle to see all the options.

rsweny avatar Apr 02 '16 12:04 rsweny

Actually this may need to have been done before you migrated.. post-migration may have to either deploy your own local Parse Dashboard or you may have to edit the _SCHEMA table manually.

rsweny avatar Apr 02 '16 13:04 rsweny

Hi there, it doesn't work with AWS. Can you help ?

ghost avatar May 24 '16 10:05 ghost

Yeah, please advise on AWS how to get parse server working with facebook integration.

michalumni avatar Jun 21 '16 00:06 michalumni

Works for me in AWS. I just had an issue with my App id configuration in AWS.

josenriq avatar Jun 24 '16 18:06 josenriq

Btw, just saw this thread and running into the same issue on Heroku..

2016-08-22T21:37:45.224619+00:00 app[web.1]:       "access_token": "EAANjrpgib6ABABUE...",
2016-08-22T21:37:45.271795+00:00 app[web.1]: error: Uncaught internal server error. Failed to validate this access token with Facebook. undefined
2016-08-22T21:37:45.270803+00:00 app[web.1]: error: Error generating response. 'Failed to validate this access token with Facebook.' error=Failed to validate this access token with Facebook.
2016-08-22T21:37:45.224619+00:00 app[web.1]:       "expiration_date": "2016-10-21T17:20:42.036Z"
2016-08-22T21:37:45.298670+00:00 app[web.1]: Failed to validate this access token with Facebook.

We are using the latest iOS SDK and latest parse server 2.2.18

I have this in my index.js

  databaseURI: databaseUri || 'xxx',
  cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
  appId: process.env.APP_ID || 'xxx',
  facebookAppIds: ['123456789'],
  masterKey: process.env.MASTER_KEY || '',
  restAPIKeY: process.env.RESTAPI_KEY || '',
  serverURL: process.env.SERVER_URL || 'https://xxx',  // Don't forget to change to https if needed
  fileKey: process.env.FILE_KEY || 'xxx',
  filesAdapter: new S3Adapter(
    process.env.AWS_ACCESS_KEY || 'xxx',
    process.env.AWS_SECRET_ACCESS_KEY || 'xxx',
    "bucket",
    {directAccess: true}
  ),
  push: {
    ios: [
      {
        pfx: 'xxxx', // Prod PFX or P12
        bundleId: 'xxx',
        production: true // Prod
      }
    ]
  }  
});

Any ideas?

gateway avatar Aug 22 '16 21:08 gateway

Hi everyone, I have installed parse server on heroku but I can not login with facebook.

This is my configuration:

var api = new ParseServer({ databaseURI: databaseUri || 'mongodb://localhost:27017/dev', cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js', appId: process.env.APP_ID || 'myAppId', masterKey: process.env.MASTER_KEY || '', //Add your master key here. Keep it secret! serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse', // Don't forget to change to https if needed facebookAppIds: [process.env.FACEBOOK_APP_ID], liveQuery: { classNames: ["Posts", "Comments"] // List of classes to support for query subscriptions } });

I set my FACEBOOK_APP_ID on heroku.

The message that I get on the android app is:

08-23 18:01:29.970 15226-15226/com.ginofarisano.jointandem W/ParseLoginFragment: Facebook login failed, exception: com.parse.ParseException: Errore di accesso: Si è verificato un errore durante l'accesso a questa applicazione. Riprova più tardi.

Help me, thanks and sorry for my english.

ginofarisano avatar Aug 23 '16 17:08 ginofarisano