title: Firebase captcha check fails and prevents user from authenticating
body: <p>I dont have idea why this error pop up . When I run the app on other device the app goes well but when I face issue on other device . Also I have issue while I am accessing firebase via wifi . I have contacted firebase support they say in INDIA they are facing issue with server and isp</p>
  <p>otpVerification.kt</p>
  <pre><code>const val USER_REF:String=&quot;user&quot;
  class OtpVerification : AppCompatActivity() {
  
  
  lateinit var  auth: FirebaseAuth
  
  private var mAuthVerificationId: String? = null
  
  private var mOtpText: EditText? = null
  private var mVerifyBtn: Button? = null
  
  private var mOtpProgress: ProgressBar? = null
  
  private var mOtpFeedback: TextView? = null
  
  lateinit var email:String
  lateinit var password: String
  
  private lateinit var database: DatabaseReference
  
  lateinit  var uname:String
  
  
  lateinit  var mCurrentUser: FirebaseUser
  override fun onCreate(savedInstanceState: Bundle?) {
      super.onCreate(savedInstanceState)
      setContentView(R.layout.activity_otp_verification)
  
  
      mAuthVerificationId = intent.getStringExtra(&quot;AuthCredentials&quot;)
      Log.d(&quot;AuthCredentials&quot;, mAuthVerificationId.toString())
  
      email= intent.getStringExtra(&quot;email&quot;).toString()
      password= intent.getStringExtra(&quot;password&quot;).toString()
      uname= intent.getStringExtra(&quot;name&quot;).toString()
  
      mOtpFeedback = findViewById(R.id.otp_form_feedback)
      mOtpProgress = findViewById(R.id.otp_progress_bar)
      mOtpText = findViewById(R.id.otp_text_view)
  
  
      auth=Firebase.auth
  
      database = FirebaseDatabase.getInstance().reference
  
  
      mVerifyBtn = findViewById(R.id.verify_btn)
  
      mVerifyBtn?.setOnClickListener(View.OnClickListener {
          val otp = mOtpText?.text.toString()
          if (otp.isEmpty()) {
              mOtpFeedback?.visibility = View.VISIBLE
              mOtpFeedback?.text = &quot;Please fill in the form and try again.&quot;
          } else {
              mOtpProgress?.visibility = View.VISIBLE
              mVerifyBtn?.isEnabled = false
              val credential = PhoneAuthProvider.getCredential(mAuthVerificationId!!, otp)
              signInWithPhoneAuthCredential(credential)
          }
      })
    }
  
    private fun signInWithPhoneAuthCredential(credential: PhoneAuthCredential) {
      auth?.signInWithCredential(credential)
              ?.addOnCompleteListener(this,
                      OnCompleteListener&lt;AuthResult?&gt; { task -&gt;
                          if (task.isSuccessful) {
  
                              createAccount(email,password)
                              mCurrentUser= auth.currentUser!!
                              Prefs.put(this, mCurrentUser)
                              Log.d(&quot;user&quot;,mCurrentUser.toString())
                              sendUserToHome()
                              Log.d(&quot;TAG&quot;, &quot;Task is succesful&quot;)
                              // ...
                          } else {
                              if (task.exception is FirebaseAuthInvalidCredentialsException) {
                                  // The verification code entered was invalid
                                  mOtpFeedback?.visibility = View.VISIBLE
                                  mOtpFeedback?.text = &quot;There was an error verifying OTP&quot;
                              }
                          }
                          mOtpProgress?.visibility = View.INVISIBLE
                          mVerifyBtn?.isEnabled = true
                      })
   }
  
  
   fun sendUserToHome() {
      val intent = Intent(this, MainActivity::class.java)
      intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
      startActivity(intent)
      finish()
  }
  
  private fun createAccount(email: String, password: String) {
      Log.d(&quot;TAG&quot;, &quot;createAccount:${email.toString()}&quot;)
      //Log.d(&quot;TAG&quot;, &quot;validate form is ${validateForm().toString()}&quot;)
  
      // [START create_user_with_email]
      auth.createUserWithEmailAndPassword(email, password)
              .addOnCompleteListener(this) { task -&gt;
                  if (task.isSuccessful) {
                      // Sign in success, update UI with the signed-in user's information
                      Log.d(&quot;TAG&quot;, &quot;createUserWithEmail:success&quot;)
                      val user = auth.currentUser
  
                      Toast.makeText(baseContext, &quot;Authentication Success $user&quot;, Toast.LENGTH_SHORT)
                              .show()
                      sendEmailVerification()
  
                      val intent = Intent(this, MainActivity::class.java)
                      intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
                      startActivity(intent)
                      Log.d(&quot;Delete&quot;, &quot;deleting activity signup&quot;)
  
                      finish()
  
                  } else {
                      // If sign in fails, display a message to the user.
                      Log.w(&quot;TAG&quot;, &quot;createUserWithEmail:failure&quot;, task.exception)
                      Toast.makeText(
                              baseContext, &quot;Authentication failed.&quot;,
                              Toast.LENGTH_SHORT
                      ).show()
                      //                   updateUI(null)
                  }
  
                  // [START_EXCLUDE]
  
                  // [END_EXCLUDE]
              }
      // [END create_user_with_email]
  createUSer()
  }
  
  private fun sendEmailVerification() {
             // Send verification email
      // [START send_email_verification]
      val user = auth.currentUser!!
      user.sendEmailVerification()
              .addOnCompleteListener(this) { task -&gt;
  
                  if (task.isSuccessful) {
                      Toast.makeText(baseContext,
                              &quot;Verification email sent to ${user.email} &quot;,
                              Toast.LENGTH_SHORT).show()
  
                      Log.d(&quot;TAG&quot;, &quot;sendEmailVerification&quot;)
                  } else {
                      Log.d(&quot;TAG&quot;, &quot;sendEmailVerification&quot;, task.exception)
                      Toast.makeText(baseContext,
                              &quot;Failed to send verification email.&quot;,
                              Toast.LENGTH_SHORT).show()
                  }
                  // [END_EXCLUDE]
              }
      // [END send_email_verification]
  }
  
  fun createUSer(){
      database.child(USER_REF).child(uname).child(&quot;email&quot;).setValue(email)
      Log.d(&quot;CREATED&quot;,&quot;create user&quot;+uname)
  }
  
  
  }
  </code></pre>
  <p>logcat</p>
  <pre><code>2020-11-11 17:57:45.290 28364-28364/com.bva_valai_pada E/zza: Problem 
  retrieving SafetyNet Token: 7: 
  2020-11-11 17:57:45.358 28364-28364/com.bva_valai_pada W/ActivityThread: 
  handleWindowVisibility: no activity for token android.os.BinderProxy@5308a64
  2020-11-11 17:57:45.873 28364-30352/com.bva_valai_pada E/FirebaseAuth: 
  [GetAuthDomainTask] Error getting project config. Failed with {
    &quot;error&quot;: {
      &quot;code&quot;: 400,
      &quot;message&quot;: &quot;INVALID_CERT_HASH&quot;,
      &quot;errors&quot;: [
        {
          &quot;message&quot;: &quot;INVALID_CERT_HASH&quot;,
          &quot;domain&quot;: &quot;global&quot;,
          &quot;reason&quot;: &quot;invalid&quot;
        }
      ]
    }
  }
   400
  2020-11-11 17:57:45.919 28364-28364/com.bva_valai_pada E/zza: Failed to get 
  reCAPTCHA token - calling backend without app verification
  2020-11-11 17:57:45.962 28364-28364/com.bva_valai_pada I/AssistStructure: 
  Flattened final assist data: 4392 bytes, containing 1 windows, 13 views
  2020-11-11 17:57:45.966 28364-28410/com.bva_valai_pada W/System: Ignoring 
  header X-Firebase-Locale because its value was null.
  2020-11-11 17:57:46.611 28364-28410/com.bva_valai_pada E/FirebaseAuth: 
  [SmsRetrieverHelper] SMS verification code request failed: unknown status 
  code: 17093 null
  2020-11-11 17:57:46.621 28364-28364/com.bva_valai_pada D/Exception: 
  com.google.firebase.auth.FirebaseAuthException: This request is missing a 
  valid app identifier, meaning that neither SafetyNet checks nor reCAPTCHA 
  checks succeeded. Please try again, or check the logcat for more details.
  </code></pre>