Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable AccountChooser for Firebase Auth

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

like image 820
Dito Avatar asked May 22 '16 02:05

Dito


3 Answers

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);
like image 165
My Name Avatar answered Nov 16 '22 19:11

My Name


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

like image 22
John Henderson Avatar answered Nov 16 '22 21:11

John Henderson


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);
like image 1
paulo carraca Avatar answered Nov 16 '22 21:11

paulo carraca