firebase-js-sdk icon indicating copy to clipboard operation
firebase-js-sdk copied to clipboard

Microsoft SSO returns error: `auth/account-exists-with-different-credential`

Open doender opened this issue 1 year ago • 1 comments

Operating System

MacOS 12.6.6

Browser Version

Chrome 120

Firebase SDK Version

9.15.0

Firebase SDK Product:

Auth

Describe your project's tooling

React app with webpack and jest, bootstrapped by NX

Describe the problem

After configuring our app in Azure and creating a Microsoft Business account (which gives me a *@*.onmicrosoft.com email address), we can successfully login (using the popup method), but Firebase returns the following error: auth/account-exists-with-different-credential. However, there is no existing account with that email address.

Steps and code to reproduce issue

const provider = OAuthProvider('microsoft.com');
provider.setCustomParameters({ prompt: 'select_account' });
await signInWithPopup(auth, provider);

doender avatar Jan 22 '24 10:01 doender

After investigating this further, in a project where we didn't upgrade the authentication to use Identity Platform, using microsoft as IdP worked. After upgrading that project as well, we get the same error, so issue seems to stem from Identity Platform.

Does that ring any bells?

doender avatar Jan 29 '24 11:01 doender

Hi @doender,

I believe your question is better answered by our backend team and isn't quite in the domain of the SDK teams. I see that it's been a while. If you still have questions I recommend reaching out to the Firebase Support team directly. Thanks!

DellaBitta avatar Apr 26 '24 14:04 DellaBitta