Skip to content

[firebase_auth]: account-exists-with-different-credential exception does not include email and credential so the plugin does not allow to link the accounts #17160

Description

@ohhyungkwon

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Auth

Which platforms are affected?

iOS

Description

User already has an account with email provider and try to sign in with Microsoft. The account-exists-with-different-credential exception rises but the exception does not have an email and credential property. According to the document, the exception is supposed to have the properties so user can link the existing account with Microsoft account. It works with android but does not with iOS.

Reproducing the issue

  1. Sign up with email provider. => Make sure there is an account in firebase console.
  2. Sign in with Microsoft with same email using below code.
final provider = OAuthProvider('microsoft.com');
// or final provider = MicrosoftAuthProvider();

provider.setCustomParameters({'prompt': 'select_account'});

UserCredential userCredential = await FirebaseAuth.instance.signInWithProvider(provider);

Expected behavior:
account-exists-with-different-credential rises and it has email and credential property.

Actual behavior:
account-exists-with-different-credential rises and it does not have email and credential property.

Firebase Core version

3.10.1

Flutter Version

3.22.3

Relevant Log Output

Flutter dependencies

...
firebase_core: ^3.10.1
firebase_auth: ^5.4.1
firebase_crashlytics: ^4.3.1
google_sign_in: ^6.2.2
...

Additional context and comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions