Sign in via Google or Facebook, Firebase will give you a token. With this token, ask firebase, firebase will tell you who is the user. You take firebase as your backend/database server, focus on developing apps only.
Diagram here