1

I'm currently developing an Angular2 App which uses Firebase as Usersystem with the following provider: Email + Password, Facebook, Google

The Problem is when i login with Facebook i can't change the Facebook account anymore. When i logout and click on 'Login with Facebook' again automatically the user from before is used.

By the GoogleAuthProvider i can manage the account change as following

const googleAuthProvider = new firebase.auth.GoogleAuthProvider();
googleAuthProvider.setCustomParameters({prompt: 'select_account'});

But i can't do the same by Facebook since the Api is different and i can't find a similar option in the docs.

Has someone encountered the same problem?

Mick Blind
  • 21
  • 3

2 Answers2

1

Signing out of Firebase does not automatically sign the user out of Facebook. So you'll have to add an explicit call for that if you want them to be signed out.

LoginManager.getInstance().logOut()

See https://stackoverflow.com/a/29559001/209103 and https://developers.facebook.com/docs/reference/android/current/class/LoginManager/.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
0

Unlike Google, Facebook doesn't support the ability to sign in to multiple accounts at the same time. The closest thing you have to prompt is auth_type: 'reauthenticate' which forces the user to enter his/her password again. This could at least make the user aware of the Facebook account they are signing in with.

bojeil
  • 29,642
  • 4
  • 69
  • 76
  • Tried provider.setCustomParameters({ auth_type : 'reauthenticate', prompt : { auth_type : 'reauthenticate' } }); return auth.signInWithPopup(provider).then( .... }) as Promise; But didn't work out – saiy2k Jun 18 '20 at 13:07
  • `provider.setCustomParameters({ auth_type : 'reauthenticate'})`. – bojeil Jun 18 '20 at 18:27