Firebase phone authentication using nodejs

Viewed 9840

I looked over the documentation of firebase but I couldn't get any answer of verifying user identity by phone on the server side. All what I found was the FIREBASEUI or the client side authentication. So how can I authenticate users through server side like giving them inputs for their phone numbers in a form on which sends a request to the server side to render it.

1 Answers

There is no server-side API for you to verify the user's phone number with Firebase Authentication.

Instead you can use the relevant client-side SDK to verify the user, and the send the user's ID token to your server, where you can then verify that it's valid. This approach is described in the Firebase documentation page "Verify ID Tokens".

Alternatively you can build your own authentication provider inside of Firebase authentication. That means you send the phone number from the client to your server, then use your own system to send the verification message(s), and finally mint a custom token identifying the now-verified user.

Related