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

前端 未结 5 2290
灰色年华
灰色年华 2020-12-18 18:56

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 ser

相关标签:
5条回答
  • 2020-12-18 19:28

    I had the same problem while integrating iOS SDK.

    If google has same architecture and classes of the firebase SDK across languages, this solution might work for you.

    Auth.auth().settings?.isAppVerificationDisabledForTesting = true
    
    0 讨论(0)
  • 2020-12-18 19:28
     firebase.initializeApp(firebaseConfig);
      // Create a Recaptcha verifier instance globally
      // Calls submitPhoneNumberAuth() when the captcha is verified
      window.recaptchaVerifier = new firebase.auth.RecaptchaVerifier(
        "recaptcha-container",
        {
          size: "invisible",
          callback: function(response) {
            submitPhoneNumberAuth();
          }
        }
      );
    
    0 讨论(0)
  • 2020-12-18 19:30

    use size: "normal" to size: "invisible"

     window.recaptchaVerifier = new firebase.auth.RecaptchaVerifier(
        "recaptcha-container",
        {
          size: "invisible",
          callback: function(response) {
            submitPhoneNumberAuth();
          }
        }
      );
    
    0 讨论(0)
  • 2020-12-18 19:32

    Firebase provides two properties for captcha size

    1. Normal - which is visible and captcha code visible to the user and manually perform the captcha process.
    2. Invisible - which is invisible to the user, automated captcha process, and code will auto render in DOM.
    window.recaptchaVerifier = new firebase.auth.RecaptchaVerifier(
        "recaptcha-container", {
            size: "invisible"
        }
    );
    

    For more details, refer to this Official Link

    0 讨论(0)
  • 2020-12-18 19:41

    You can't remove captcha verification using default authentication.

    Use anonymous authentication to avoid captcha letters to appear. Also anonymous authentication is more simpler than Firebase Authentication default authentication.

    Usage:

    firebase.auth().signInAnonymously().catch(function(error) {
      // Handle Errors here.
      var errorCode = error.code;
      var errorMessage = error.message;
      // ...
    });
    

    For details please follow this official documentation : https://firebase.google.com/docs/auth/web/anonymous-auth

    0 讨论(0)
提交回复
热议问题