简体   繁体   中英

How can i authenticate user phone number on server side in nodejs with firebase auth

Is it possible to authenticate a user's phone number or email in nodejs environment instead of using firebase client sdk's for Android and iOS. Use case here is client sends phone number and otp to server and server authenticates it and creates a user of number/email if verified.

In client sdk there is signInWithPhoneNumber method which is used to authenticate mobile numbers, I want to know if it is possible to move this process to server side so client doesn't have to handle sdk's

What would be the ideal way to proceed here?

I'm not sure if I understand you. Maybe, you should write your own rules in security rules. Then you don't need to mess with nodejs/serverside solutions.

The second thing, nodejs is JavaScript so, if you can install packages on the backend side like express, etc. You suppose to add firebase packages as well. So in theory, you should install it and use it on the server-side in the same way as in the frontend. Then you can just add some more validation on the server, writing your own regexp to check if the number is correct.

I never use it but theoretically, it is possible.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM