title: Firebase Admin SDK create user using providers
body: <p>I am trying to create a REST API for my app using Firebase Cloud Functions. I know how to use Admin SDK in Cloud Functions. It does have API to <code>createUser</code>. My front end app lets users sign in using Google and Facebook but I am not sure how to put it all together. </p>
  
  <p>My app has successfully implemented <code>Sign in with Google</code> and <code>Sign in with Facebook</code> but how and what data do I transfer over to Cloud Functions (or any REST API Server for that matter) so that it could create a user in Firebase with appropriate provider.</p>
  
  <p><strong>Update for more explanation</strong></p>
  
  <p>I am creating an app for iOS and Android with some sort of cloud based backend. Right now I am experimenting with Firebase but I do not intend to tightly couple my apps to Firebase and hence do not want to pull Firebase-iOS and Firebase-Android SDKs into my app code. I want the ability and freedom to switch my backend over to AWS or Azure without changing frontend code.</p>
  
  <p>The one (and only?) way is to create a server that will expose REST API endpoints and do the work on my behalf that usually SDK does. To achieve this, I am using Cloud Functions but that shouldn't matter as long as I have API to talk to actual cloud.</p>
  
  <p>After putting that explanation, now my question is how do I let my users login to app using external providers like Google and Facebook and still achieve what I am trying to do. When I let users sign in with providers, I do not have their password to send to backend to create a new email/password user.</p>