title: Migrating Users From Facebook's "Raw" Authentication to Firebase Based Facebook Authentication
body: <p>I am working on a project which needs User Authentication. The &quot;Clients&quot; are iOS (Swift) or Android (Kotlin) native applications. The original form of the API (NodeJS) used Facebook and Account Kit for OAuth and Phone authentication respectively. Since Account Kit shutdown, we moved to Firebase Phone Authentication for Phone but left Facebook in its original form. Now, we're wanting to consolidate our Authentication providers (to Firebase) but I can't seem to find a way to &quot;convert&quot; or &quot;import&quot; Facebook users to Firebase-based Facebook users.</p>
  <p>So far, I've read through the Documentation, including the category about importing users, but it doesn't seem to indicate an ability to maintain backwards compatibility, while also moving forward to Firebase. What I mean is, it has an ability to set information, but it doesn't indicate that the same information will be used to authenticate that user as the same unique visitor.</p>
  <p>What I am looking for is either transitory logic, which will handle this during login, or preferably, a &quot;bulk-insert&quot; type migration. Essentially, I want to have it setup so that the API only needs to keep a single authentication UID, and use only a single third party (even if they then use another subsequent third party) while maintaining user uniqueness (so that it doesn't create a new user for the same Facebook account).</p>
  <p>Part of my problem in creating a temporary patch (not necessary if the main question is answered) is that I don't know of a way to differentiate between a Facebook UID and a Firebase UID to fork the logic. Again, this is only relevant if there isn't a solution for migration.</p>
  <p>Feel free to request any more details that would be useful.</p>
  <p>Update #1</p>
  <p>I realized my question was open ended in what I was asking. I've been digging further and can better define my question:</p>
  <p>I need a way to bulk insert users into Firebase's Authentication with a provider of Facebook. I know I can import them, via <code>admin.auth().importUsers([...])</code> and that I can create accounts via <code>admin.auth().createUser({...})</code> but when I do the former I can't seem to get back the user's UID, and the latter doesn't seem to allow specifying a provider. Am I missing something?</p>