I am creating an Android native app and I am using Firebase Auth with multiple auth provides such as; Email, Facebook, Google etc, I will use the Firebase SDK for chat and real-time DB.
I have a RESTful API with a MySQL (similar to Facebook with; friends, private and public posts), a user database behind a PHP server and I would like to synchronize the Auth so that I can ensure that the user is correct and has a authority to access data for which they have permissions. I am able to edit and change my database so I can adapt it to suggestions here.
(I originally thought I might need something like OAuth however I no longer think that is necessary)
After much research, I think that I need to securely communicate the users email and the Firebase Auth token to the MySQL whilst keeping details in sync? It seems like this would be something that would be quite common but I haven't been able to find a definitive answer.
(If the above statement is true)
My questions are:
- Is the email and Auth token all that is required to Auth a user via the server
- Should the Auth token get sent to Firebase SDK using the PHP SDK
- How should credentials be stored in the MySQL DB with regards to security
- How does the Auth token expire and/or become refreshed
- How should information be sent securely from the Android client to the MySQL database
- What is the correct procedure and strategy for updating Auth tokens
- What is the correct sync strategy for Auth details, such as email address and tokens between client and server
- Am I even on the right track :)
I'm new to most Auth concepts.
Best regards