0

Problem

Firebase force overwrites previous authentication provider when we sign-up using Google OAuth.

Precondition

  • Both GitHub account and Google one are the same email.
  • Disallow multiple accounts with the same email address

Expected Behavior

  1. Sign-up using GitHub OAuth
  2. A new account (ACCOUNT_1) is created on Firebase Auth
  3. Sign-out
  4. Sign-up using Google OAuth, "auth/account-exists-with-different-credential" error occurs.

Actual

  1. Sign-up using GitHub OAuth
  2. A new account (ACCOUNT_1) is created on Firebase Auth
  3. Sign-out
  4. Sign-up using Google OAuth
  5. ACCOUNT_1 is overwritten by Google OAuth provider on Firebase.
  6. Sign-in using GitHub OAuth, "auth/account-exists-with-different-credential" error occurs.

What I tried

  • When a new account is created first time, I force updated emailVerified = True using Cloud Functions.

I saw the bellow article:

In my understanding, Google OAuth process only overwrites an account with non-verified email.

  • 1
    As bojeil said in the comment you linked: Google is the preferred provider for GMail addresses. Also see https://groups.google.com/forum/#!searchin/firebase-talk/liu/firebase-talk/ms_NVQem_Cw/8g7BFk1IAAAJ (linked from https://stackoverflow.com/questions/37947944/authentication-using-facebook-at-first-and-then-google-causes-an-error-in-fireba/37973121#37973121) – Frank van Puffelen Jul 10 '17 at 13:50
  • @FrankvanPuffelen thank you for your response. I understood, Unfortunately, It is not a bug. But I can not agree with Google's concept... – Takahiro Ikeuchi Jul 10 '17 at 14:19
  • That is not a question anyone here on Stack Overflow can answer. If you'd like this behavior to be changed, I recommend that you [file a bug report or feature request](https://firebase.google.com/support/contact/bugs-features/). – Frank van Puffelen Jul 10 '17 at 14:24
  • Yes, I'll send the feature request. – Takahiro Ikeuchi Jul 11 '17 at 04:20

0 Answers0