Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine which provider the user logged in with

I am using multiple Firebase sign in methods in my app (Facebook, Google, Phone, etc). But once the user is logged in, I am unable to determine which provider was used to sign in.

I tried below(very close to the recommended solution. But does not work): _auth.currentUser().providerData[0].providerId

I expect it to return something like "google.com" or "facebook.com" Instead it returns "firebase"

I cant find any other solution where it clearly lets us determine if a google or facebook sign in was used. All solutions in the forum iOS specific or for web. Can't find anything flutter specific. Appreciate any help in advance.

like image 900
Vinayakaram Nagarajan Avatar asked Aug 31 '25 10:08

Vinayakaram Nagarajan


1 Answers

I checked and _auth.currentUser().providerData[0].providerId does provide "google.com" or "facebook.com"

Not sure at what point it showed me "firebase". Will post to this if I figure this out

like image 123
Vinayakaram Nagarajan Avatar answered Sep 02 '25 23:09

Vinayakaram Nagarajan