question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enforce account selection on GoogleAuthProvider signInWithRedirect

See original GitHub issue

When 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:closed
  • Created 7 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
bojeil-googlecommented, Jun 9, 2017

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 the prompt field that Google OAuth supports.

1reaction
bojeil-googlecommented, Jun 4, 2017

This is a duplicate of this issue: https://github.com/firebase/firebaseui-web/issues/61 It’s in the works. Sorry about the delay.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Easily add sign-in to your Web app with FirebaseUI - Google
Account Linking - flows to safely link user accounts across identity providers. ... GoogleAuthProvider. ... Forces account selection even when one account
Read more >
Signing in users with Google | Identity Platform Documentation
Go to the Identity Providers page in the Google Cloud console. · Click Add A Provider. · Select Google from the list. ·...
Read more >
Firebase google auth automatically selecting user. How to ...
I am using const googleCredential = firebase.auth.GoogleAuthProvider.credential(response.idToken); firebase.auth().
Read more >
Authentication - Redux Saga Firebase
Applies a verification code sent to the user by email or other out-of-band ... GoogleAuthProvider(); function* linkSaga() { try { yield call(rsf.auth.
Read more >
Handling user authentication with Firebase in your React apps
Press enable, select a project support email address, and click on Save to activate Google Authentication for our app. Now, let's set up...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found