Search code examples
python-3.xfirebasefirebase-admin

Firebase Python Admin: provider_id only returning "firebase" and not "google.com"


Hope you guys are having a great day!

I have run into an issue with the Firebase Python Admin SDK.

ISSUE: I am using [user = auth.get_user("firebase-user-uid")] to return info on specific accounts, everything works until I try to get the account provider ID using [account_type = user.provider_id] the expected returned string would be "google.com" but I am getting "firebase" returned instead (this issue is happening to all users, no matter the provider).

Any help would be greatly appreciated. Thank you guys for your time!

Edit: My goal with getting the provider ID is to display the account sign in type to the user using flask!


Solution

  • The "top-level" provider_id of someone signed into Firebase Authentication is expected to be "firebase" because it is obtained from the Firebase ID token issued to the user.

    Linked account providers, like Google, Facebook and so on are found under the provider_data property of the UserRecord object as a list of UserInfo objects.