'Force an existing user to sign-in with a specific account

Similar to Invoke "Verify it's you" authentication page from a Firebase application use case, but my case differs in that the user is not logged in, but I want to force to log in as an existing user already registered in our app.

Use case: requiring an existing user that's just been invited to join a team to log in as given user (if she's currently logged out), or re-log as given user (if she's currently logged in to different account).

So, given either user_id or email, can I force the popup to preselect given account? We're using https://github.com/firebase/firebaseui-web/, but passing the login_hint, as I understand it, won't help here:

signInOptions: [
    {
        provider: firebase.auth.GoogleAuthProvider.PROVIDER_ID,
        customParameters: {
            prompt: "select_account",
            login_hint: `[email protected]`,
        }
    },
    firebase.auth.FacebookAuthProvider.PROVIDER_ID,
    firebase.auth.GithubAuthProvider.PROVIDER_ID,
]

Even if it did, it would work only for google provider. Ideally, it should work for all providers.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source