Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login error auth/account-exists-with-different-credential #968

Open
BadDay opened this issue Nov 18, 2024 · 3 comments
Open

Login error auth/account-exists-with-different-credential #968

BadDay opened this issue Nov 18, 2024 · 3 comments

Comments

@BadDay
Copy link

BadDay commented Nov 18, 2024

Hi,
When I try to login via Github an error occurr

{error: FirebaseError: Firebase: Error (auth/account-exists-with-different-credential).

Tried to clear the cookies, but without luck. Credentials are ok, because I am able to login to Github. I found similar issue on stack
https://stackoverflow.com/questions/44015751/firebase-js-api-auth-account-exists-with-different-credential

When tried login via Google - it's ok

@FactorioBlueprints
Copy link
Owner

I checked which relevant Firebase settings I have enabled, and I have Link accounts that use the same email, not Create multiple accounts for each identity provider. I think that's the right choice. I'm not sure if that SO question says I need to make a code change.

@grongor
Copy link

grongor commented Nov 20, 2024

I can confirm that the same thing just happened to me...

@maxbethke
Copy link

I checked which relevant Firebase settings I have enabled, and I have Link accounts that use the same email, not Create multiple accounts for each identity provider. I think that's the right choice. I'm not sure if that SO question says I need to make a code change.

I think you misunderstood that setting. It means that Firebase wont create multiple accounts with the same e-mail address for THE SAME Identity Provider. A new AuthProvider still needs to be manually linked to an existing account, while that is authenticated. I guess automatic linking across Provider would be a security risk, because you can not rely on the email being verified on each provider.

In this scenario, the users account waa created with the EmailProvider and now the user wants to use the GithubProvider with the same email
Since the Email must be unique, the error gets thrown, because It cant create a new Account.

The user would have to authenticate with the EmailProvider and link their account with GitHub first. This could be done using some sort of profile page or as a guided process after the error got thrown.

Docs: https://firebase.google.com/docs/auth/web/account-linking

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants