Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove captcha verification from Firebase phone auth using javascript?

I am using firebase phone auth for the very first time and I see captcha verification is must proceed with the process, as per firebase official documentation. Though it serves a good purpose, but sometimes it becomes very bad for the user experience when it starts asking about the road signs, bridges and all. Is there a way to directly skip to the verification code right after getting user's number? As per the documentation, the code is mentioned below. Thanks.

var phoneNumber = getPhoneNumberFromUserInput(); var appVerifier = window.recaptchaVerifier; firebase.auth().signInWithPhoneNumber(phoneNumber, appVerifier)     .then(function (confirmationResult) {       // SMS sent. Prompt user to type the code from the message, then sign the       // user in with confirmationResult.confirm(code).       window.confirmationResult = confirmationResult;     }).catch(function (error) {       // Error; SMS not sent       // ... });  var code = getCodeFromUserInput(); confirmationResult.confirm(code).then(function (result) {   // User signed in successfully.   var user = result.user;   // ... }).catch(function (error) {   // User couldn't sign in (bad verification code?)   // ... }); 
like image 595
Vinay Singh Avatar asked Jul 05 '18 06:07

Vinay Singh


People also ask

How do I fix this app is not authorized to use Firebase authentication?

Make sure you add the SHA1 key from Play Console to your app in the Firebase Console. Also, the google-services. json file needs to be downloaded again, and added to app, after submitting to app store. Then re-upload to google play store.


1 Answers

Go to Firebase console -->to your project-->project overview settings-->project settings --> App check -->overview (Register your app for SafetyNet).

Then your app will stop redirecting to web for captcha verification

enter image description here

like image 158
Arun Kumar Avatar answered Sep 18 '22 19:09

Arun Kumar