Firebase Auth with Microsoft and OIDC-Microsoft results in different User-IDs

46 views Asked by At

We have developed an Application that uses Firebase-Auth for authentication. As Login-Method we have configured Microsoft in Firebase.

If a new User logs in, Firebase creates a new User (with a Google unique ID) and adds the Microsoft login details to the User record (to the providerData Array). If you look at the providerData Details, you see that firebase uses the oid from the Microsoft JWT as the uid in the specific login method entry (NOT the Firebase User Id).

Now we want to switch from the "build in" Microsoft provider to OIDC provider, because you can not configure the Microsoft Provider via a cloud function (OIDC works perfect).

The OIDC Provider works as intended, but has one difference. Now the User Record"s providerData does not has the oid from the Microsoft JWT as the specific uid, but the value in the "sub" Claim from the Microsoft JWT (the sub Id is unique per user per application registration, the oid is only unique per User).

Is there any config option, that we could still get the oid as the specific uid and not the "sub id"? We use these IDs to talk to the Microsoft Graph API and need the User's oid.

0

There are 0 answers