2

I am attempting to set up reCAPTCHA Enterprise on my Android app. I currently have the legacy reCAPTCHA system via the SafetyNet API, but Google is retiring that and so I need to transition over to the Play Integrity API with reCAPTCHA Enterprise. I have the API set up in Google Cloud, and I have created 2 different Android keys for testing purposes, one with my package name specified and one with package verification disabled. I followed Google's Android project setup documentation, but neither key will allow me to get the reCAPTCHA client. This is from my main activity:

lifecycleScope.launch {
    Recaptcha.getClient(application, "my key here")
      .onSuccess { 
        recaptchaClient = it
      }
      .onFailure { exception ->
        println(exception)
      }
  }
com.google.android.recaptcha.RecaptchaException: Key type invalid

I have checked the documentation, and this error is returned when:

Cannot create a reCAPTCHA client with a non-Android site key.

Please register new site key with the key type set to "Android app" via Create key.

Both of the keys I have attempted are Android keys, shown here in the Google Cloud -> Security -> reCAPTCHA Enterprise page. reCAPTCHA Enterprise keys

I am at a loss for what else to try. This appear to be the right keys, for the right platform, with the right service that is enabled. Anyone know what step I might be missing or how else to resolve this issue?

Stonz2
  • 6,306
  • 4
  • 44
  • 64

0 Answers0