Suppose I need to verify users by Firebase phone authentication.
But somehow, user is not getting otp sms. So does firebase gives the option to get the OTP by receiving call?
You can use Firebase Authentication to sign in a new user by sending an SMS message to his phone, he would then receive a verification code to his phone number via SMS which would then allow him to sign in if the code is correct. However it's not possible yet to give the user his verification code via a voice call. Maybe they will do it in a future release ? It would be great indeed !
Related
I have a use case where I need each user to be identified by a phone number, this is because my shops will need to call the users who request an order , I have followed the documentation and all the github repo with the code
Actually the code worked, and sended to me the sms to verify and all worked just fine !
Now, before release, I have just plugged another phone, requested the code to verify and the code never arrived !
I just tried in another phone with another number and also the verification code has never reached that phone either.
But I actually verified a phone number with the actual code and it works, so, why is the code not reaching my users phone ?
My use case needs this feature and if this is on Firebase side I will need to move to another service
Any suggestions ?
For testing you can use the verification code you added with the test phone number on the console.
Firebase Console Dashboard -> Authentication -> SignIn Method -> Phone -> Phone numbers for testing.
Sometimes, firebase don't need to send the otp for confirmation. it can automatically be done.
This method is called in two situations:
Instant verification: in some cases the phone number can be instantly verified without needing to send or enter a verification code.
Auto-retrieval: on some devices, Google Play services can automatically detect the incoming verification SMS and perform verification without user action. (This capability might be unavailable with some carriers.)
In either case, the user's phone number has been verified successfully, and you can use the PhoneAuthCredential object that's passed to the callback to sign in the user.
https://firebase.google.com/docs/auth/android/phone-auth#onverificationcompletedphoneauthcredential
Check out the docs for Firebase Phone Verification for Android : https://firebase.google.com/docs/auth/android/phone-auth?authuser=1#test-with-whitelisted-phone-numbers
In my application I am going with a functionality, in which i need to authorize user's mobile number via OTP.
So, for this i need to authentic mobile number via OTP Call using Firebase Service. Currently I am doing research but, not able to find any solution regarding OTP Verification via call with Firebase.
I have already implemented this functionality using Firebase Authentication phone number sign-in service with SMS verification method.
Any source/help would be appreciated.
Currently firebase does not provide OTP over call, you'll have to use only SMS OTP service or look for other OTP over call service providers like twilio or nexmo
Note: I haven't tried any of these. I just Googled for OTP over call service providers. Please search before you select one.
Firebase Authentication doesn't provide OTP call verification as of now.
I want to make an app in Android Studio where the user will have to register in Firebase using his mobile phone number. But the user would only be allowed to register if he verifies his phone number with the OTP sent to him via SMS.
I don't want to allow anyone with a fake phone number to register and hence I need them to verify. So is there a way to do so in Firebase?
I tried the auth.signInWithCredential() method but it seems to allow users to only sign in with an OTP. I also don't want my users to type an OTP every time they sign in. I want them to sign in using only their password and phone number.
I am developing an app wherein the users use either email and phone to perform registration.
Users can enter their email or phone for log in, I want the same OTP to be sent to mobile and email simultaneously. Please Help!
If you want to work only with Firebase Authentication, then there is not any suitable solution that meets your requirement.
Some limitations you can find with Firebase are Firebase Authentication Limits and Phone number sign-in limits.
However the alternative solution is using third-party SMS gateway. through with you can send OTP to phone number as well as to email also simultaneously.
Lets assume you already have mechanism to generate OTP and verify OTP from android app.
Now the problem is how to send OTP to the user's email.
One of solution is using MailGun service to send email from your backend.
Also, if you want to templating your email, you can use library called handlebar
The recently added phone authentication in firebase authenticates has two types of users on successful authentication as provided in the documentation:
Instant verification: in some cases the phone number can be instantly verified without needing to send or enter a verification code.
Auto-retrieval: on some devices, Google Play services can automatically detect the incoming verification SMS and perform verification without user action.
But I would like to authenticate the users on the basis of sending SMS instead. So how could it be resolved. And how can it be determined how the users are getting authenticated. Also in some cases if the user is already authenticated in some other device it automatically gets authenticated in some other device without sending the SMS on either of the devices.
Any help would be appreciated.