I have my own node.js
server setup so I don't need Firebase storage and real-time database service. From the client side (mainly Android) I am trying to authenticate the user using Firebase Authentication service(G+ and FB login) but that creates users in firebase database. How can I create users in my database also?
Currently, I am simply sending user id created by Firebase to my server and saving it in DB and generating a JWT
to validate subsequent REST API requests to my server.
Firebase account linking allows users to sign into the same account using different authentication providers. By linking the user's Facebook and Twitter credentials, for example, the user can sign into the same account using either sign-in provider.
Adding members to your Firebase project allows you to collaborate across your team. You can assign each member a role based on the level of access the member needs for your project. Project members are not limited to just individual users: domains, groups, and service accounts can all be members of a Firebase project.
Your client app will get back a Firebase JWT token after end users login with Google/Facebook. Whenever your app needs to send REST API requests to your server, just append the Firebase JWT token into the request body.
On your server, you first validate the Firebase token inside the incoming request. Once the JWT security check passes (signature, audience, expiration etc.), you can extract the 'sub' field (which is the user_id) in the token, and create a user record in your DB only if the user_id is not in DB yet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With