19

I'm trying the new FirebaseUI for Web (https://github.com/firebase/FirebaseUI-Web). But when I tried to login with Email, it redirects me to an AccountChooser website.

Is there anyway that I can turn off that AccountChooser?

Thanks

Dito
  • 191
  • 1
  • 3

4 Answers4

27

You can disable by adding an entry into the variable uiConfig in Firebase. You have to add this in the uiConfig variable:

'credentialHelper': firebaseui.auth.CredentialHelper.NONE

Here is an example of it inside uiConfig:

var uiConfig = {
    callbacks: {
        signInSuccess: function (currentUser, credential, redirectUrl) {
            return true;
        },
        uiShown: function () {
            document.getElementById('loader').style.display = 'none';
        }
    },
    //Start it here 
    credentialHelper: firebaseui.auth.CredentialHelper.NONE,
    //End it here 
    signInFlow: 'popup',
    signInSuccessUrl: '<url-to-redirect-to-on-success>',
    signInOptions: [
        // Leave the lines as is for the providers you want to offer your users.
        firebase.auth.GoogleAuthProvider.PROVIDER_ID,
        firebase.auth.FacebookAuthProvider.PROVIDER_ID,
        firebase.auth.TwitterAuthProvider.PROVIDER_ID,
        firebase.auth.EmailAuthProvider.PROVIDER_ID
    ],
    // Terms of service url.
    tosUrl: '<your-tos-url>'
};

var ui = new firebaseui.auth.AuthUI(firebase.auth());
ui.start('#firebaseui-auth-container', uiConfig);
Ralpharoo
  • 789
  • 9
  • 21
George Chalhoub
  • 14,968
  • 3
  • 38
  • 61
3

If anyone isn't bringing in firebaseui (e.g. if you're using react-firebaseui), it could be helpful know thatfirebaseui.auth.CredentialHelper.NONE === 'none'

This answer was provided in this SO question: Disable account chooser FirebaseUI React Credit to @RafikTighilt and @JeffBergman

John Henderson
  • 115
  • 2
  • 8
1

I am using /__/firebase/init.js and no explicit initialization and getting

firebaseui not initialized on ,'credentialHelper': firebaseui.auth.CredentialHelper.NONE

Solution, change the order of the statements:

  1. var ui = new ...
  2. var uiConfig = { ...
  3. ui.start('#firebaseui-auth-container', uiConfig);
Druckles
  • 3,161
  • 2
  • 41
  • 65
-1

Found a fix for this here:

https://github.com/firebase/firebaseui-web/issues/42

Download the firebase-ui-auth.js file (you can copy version 0.5 from here). You need to change one character and host the file yourself instead of using the CDN.

In the file, look for: "accountChooserEnabled",!0 and change the !0 to !1.

This did the trick for me!

moth
  • 226
  • 2
  • 9