I'm using Google reCAPTCHA Enterprise, and I'm on the stage of creating an "assessment" in my server side code (PHP). I'm following the example code from the docs but I get an error:
"Google\ApiCore\ValidationException - Could not construct ApplicationDefaultCredentials"
from the line
$client = new RecaptchaEnterpriseServiceClient();
I found this question which talks about some credentials in a JSON file, but I don't see any information anywhere about what the JSON file is supposed to be. It doesn't really make sense to me because the sitekey and token are passed in a couple lines later anyway:
$event = (new Event())->setSiteKey($recaptchaKey)->setToken($token);
In the RecaptchaEnterpriseServiceClient it appears to take an $options array, is there some way to just pass in the "credentials", whatever they are?
AUTHENTICATION. You very likely want tto use Application Default Credentials to authenticate to Google Cloud services. I'm unfamiliar with reCAPTCHA but a quick read of the docs suggests that reCAPTCHA keys and tokens are specific to the service's implementation.