Enforce account selection on GoogleAuthProvider signInWithRedirect
See original GitHub issueWhen I am logged in into the “Google Product” (gmail and such) with only one email address (user-1@gmail.com
), that account is automatically used for Firebase.Auth. This is not OK.
I may be logged into Google only with user-1@gmail.com
, but may have another Google account user-2@google.com
which I actually want to use with Firebase.
As soon as I’m logged into Google with two accounts, whenever I start a signInWithRedirect
-process, I land on accounts.google.com (I have 3rd party Cookies disabled, if that matters), where I can choose one of the two accounts, but more importantly, I also get to add another account.
So, assuming I am logged into Google with user-1@gmail.com
and user-2@gmail.com
, but I actually want to log into Firebase with user-3@gmail.com
, then I can choose to add the user-3@gmail.com
account during the sign-in procedure, which is a very natural flow.
But if I’m only logged in with user-1@gmail.com
and want to use user-3@gmail.com
with Firebase, I need to go to www.google.com, select “Add Account” from the top-right “dropdown box”, then go back to the application which is signing in, reload the page, redo a signInWithRedirect, select user-3@gmail.com
, which is the worst possible flow!
An “Add Account” should always be shown on accounts.google.com, at least it should be an option on the provider object.
This also applies to FirebaseUI, not just to the GoogleAuthProvider.
The Gitkit sign-in widget (window.google.identitytoolkit.start('#gitkitWidgetDiv', config);
) handles this perfectly, it will ask for the email-address, then check if it needs to ask for a password, or authenticate via Google, and, if required, sends you to accounts.google.com for that specific Google account (which kindly also allows you to use another account if you want to, try that option to see how well that flow is implemented)
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (6 by maintainers)
Top GitHub Comments
This should be fixed in 2.1.1 release. Check https://github.com/firebase/firebaseui-web#configure-oauth-providers You can now pass
customParameters
for OAuth providers. This will accept theprompt
field that Google OAuth supports.This is a duplicate of this issue: https://github.com/firebase/firebaseui-web/issues/61 It’s in the works. Sorry about the delay.