skip to Main Content

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


  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/.

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search