google recaptcha enterprise

I am using php to post API to get Assessment, the request like

$payload = [
            'event' => [
                "token" => $request->input('g-recaptcha-response', ''),
                "expectedAction" => 'form',
                "siteKey" => $secretKey,
            ]
        ];

And the request url:

$requestUrl = 'https://recaptchaenterprise.googleapis.com/v1/projects/'.$projectId.'/assessments?key='

Now I am get error:

array:1 [▼
  "error" => array:3 [▼
    "code" => 400
    "message" => "At least one of the following Assessment fields is required: event.token, private_password_leak_verification."
    "status" => "INVALID_ARGUMENT"
  ]
]

Could I know if I missed any params in request? And what is private_password_leak_verification please

1 Like

Hello @YMJ1983 ,

Below is the JSON representation of PrivatePasswordLeakVerification

{
  "lookupHashPrefix": string,
  "encryptedUserCredentialsHash": string,
  "encryptedLeakMatchPrefixes": [
    string
  ],
  "reencryptedUserCredentialsHash": string
}

Attaching here the reference documentation for further details. Password leak verification describes how to use the password leak detection feature of reCAPTCHA Enterprise to detect password leaks and breached credentials to prevent account takeovers (ATOs) and credential stuffing attacks.