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?
2
Answers
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.
See https://stackoverflow.com/a/29559001/209103 and https://developers.facebook.com/docs/reference/android/current/class/LoginManager/.
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
isauth_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.