Hullo,
I've update the module, and I obtain this fault:

Google reCAPTCHA v3 validation failed: The response parameter is invalid or malformed. Expected action did not match. Score threshold not met.

Pantheon is proud to back up Drupal and open source Pantheon logo

Comments

fvincenti's picture

cdykstra's picture

Post-obit as we're having the same result.

Even subsequently generating new v3 keys and updating the recaptcha_v3 settings in Drupal with new keys, and lowering the threshold we still see the same mistake.

dench0's picture

Hi in that location, it seems like exist issues with the captcha caching. Pls try the latest dev version with disabled "Cacheable" settings.

dench0's picture

Can anyone ostend that result be for the latest dev version?

cdykstra's picture

Cheers for following upwards. We set aside implementation of this module after it failed on our site and we reverted back to recaptcha for the time being. We are still looking at using this and then I'll try to ready some time aside at the end of this week or offset of next to test out the dev version and written report back.

mortona2k's picture

Setting the threshold to 1 didn't work for me, but .9 does. Information technology'south unclear how this should be ready, but given that the v2 is a recommended compliment I presume that completing that will set up your threshold and allow v3 to work next fourth dimension.

dench0's picture

@mortona2k What means

Setting the threshold to 1 didn't work for me

?
Actually is no deviation how it human activity when threshold is 0.9 or 1. It send this value to the google and all verification happens on google side: if google user points greater or equal than threshold - verification will pass, otherwise - fail.
If yous desire to not use fallback challenge and employ recaptcha v3 on fail once again - then you just demand select - None - in the Fallback challenge select.

baikho's picture

We are experiencing the same issue as described by @mortona2k. 0.ix threshold on an Activeness works, but 1.0 threshold always fails with the default mistake message "Antibot verification failed.". Using this module on Head of 8.10-ane.x currently revision 267fc3765a172caa8e0e9396303578b446798cd0.

We also had to specify the "Fallback claiming" every bit "- None -" which otherwise would never show the v3 reCAPTCHA. When I inspect the DOM, I tin only see the .recaptcha-v3-token class appear with this option disabled as if it is superseding the v3 reCAPTCHA. Non certain if this is expected behaviour?

Really is no deviation how information technology human action when threshold is 0.9 or 1. Information technology send this value to the google and all verification happens on google side: if google user points greater or equal than threshold - verification will laissez passer, otherwise - fail.

on #8 Pitiful, I don't empathise this. How is there no divergence betwixt threshold 0.nine or 1.0? Surely in that location is a difference otherwise they wouldn't let you specify it to that granularity?

dench0's picture

How is there no difference between threshold 0.9 or i.0? Surely there is a difference otherwise they wouldn't let you specify it to that granularity?

You lot did non sympathise me. I wrote that at that place is no difference how google volition process threshold value.
If you lot will get that error with threshold 1 then google estimate possibility that you lot a homo lower than i. I'g think yous can see submitted threshold values in the google recaptcha console.

dench0's picture

Condition: Active » Airtight (outdated)

milovan's picture

Status: Closed (outdated) » Active

Hi, I am also experiencing the same trouble.
When dumping $verification_response in recaptcha_v3.module, I go "missing-input-response"
The whole dump looks similar:

                  Array (     [success] =>     [hostname] =>     [challenge_ts] =>     [apk_package_name] =>     [score] =>     [action] =>     [error-codes] => Array         (             [0] => missing-input-response         )  )                

I am using the latest version (Drupal 8, v1.3) with patch applied for "Cacheable setting is not saved when submitting the settings class (3169938)".
Even with enshroud turned off, it is the same effect.

Let me know if you need more details.

dench0's picture

@milovan
1. Endeavour the latest dev version.
2. Check the browser console for the presence of whatsoever js errors.

dench0's picture

Status: Agile » Airtight (cannot reproduce)

@milovan
I airtight the upshot because I can't reproduce it. Feel complimentary to reopen it if you will provide more than info.

KurtTrowbridge's picture

I ran into this every bit well while setting up the 1.3 version of the module on an in-development site, though it seems to exist something site-specific: other sites with the exact same configuration (version 1.3, with reCAPTCHA v3 enabled by default on the login form, with a 0.half dozen threshold and reCAPTCHA every bit a fallback) have been fine for months. Switching to the dev version of reCAPTCHA v3 seems to accept resolved it. I'm not exactly certain of the cause, but I wanted to share more than information in case it matches someone else's consequence or reveals what's going wrong:

  • The $verification_response output in #12 matches what I saw when it failed.
  • The page throws an error almost immediately upon the form submission, so I didn't get a adventure to encounter any console errors.
  • I don't take the patch mentioned in #12, nor any others related to this module.
  • The login class failed with an "unexpected error message," while a Webform failed and let me effort submitting again with the v2 fallback; submitting with v2 worked. It's possible that changes I've made to the login form Twig template are impacting things.
  • Since it's different from what's in the original report, the error message in my instance is "Google reCAPTCHA v3 validation failed: The response parameter is missing. The secret parameter is missing. Expected hostname did not match. Expected activity did not friction match. Score threshold not met." (The hostname does match the rules I accept set up in Google reCAPTCHA.)
  • There are two additional errors logged at the same fourth dimension, just when reCAPTCHA fails: Warning: assert(): The container was serialized. failed in Drupal\Core\DependencyInjection\Container->__sleep() (line 28 of /app/web/core/lib/Drupal/Cadre/DependencyInjection/Container.php) and LogicException: The database connexion is non serializable. This probably means you are serializing an object that has an indirect reference to the database connection. Arrange your code so that is not necessary. Alternatively, look at DependencySerializationTrait as a temporary solution. in Drupal\Core\Database\Connectedness->__sleep() (line 1574 of /app/web/core/lib/Drupal/Core/Database/Connection.php).
  • Peradventure worth noting: I have the Mail Login and Persistent Login modules enabled on this site and not the others where I've successfully implemented version ane.3 of the module. That shouldn't fully explicate it because Webform-based forms failed too, simply might help explain the firsthand error, instead of the fallback to v2.

milovan's picture

Condition: Closed (cannot reproduce) » Active

Hi @dench0

I reopened the issue in guild to endeavour to aid you out as much as possible to effigy out why information technology is happening on some instances (as I am not lonely with this issue).

Then hither is the latest effort:
I updated module to 1.4 as it included all from dev, cache fix too.
Just for a reminder, my setup is following:
- have caching enabled
- adding course captcha point works
- removing that and adding Captcha element to the class, submit doesn't work (submit?_format=json returns "Antibot verification failed".
- I only have Recaptcha V3 with no fallback (could that be a problem?)

And then I ran debugger and after submit I get on line 181 $user_input = $form_state->getUserInput();empty array.
There are no errors in Web browser console.

The $verification_response is the same as I posted here: https://www.drupal.org/projection/recaptcha_v3/issues/3136745#comment-13940375
And that is because $captcha_response is "".

Do you have any ideas or tips what / where to look the values in the debugger? This is not the offset fourth dimension this kind of error gets reported for this module, there has to exist some specific scenario when it fails.

dench0's picture

HI @milovan.
Try to set a breakpoint hither and check what happens there.

dench0's picture

Also, cheque which data really submitted and if in that location nowadays not empty captcha_response value. See fastened screenshot.

milovan's picture

Hey @dench0
I attached a screenshot of the payload.
The captcha_response was "Antibot verification failed."

Regarding line 208, here information technology is:
$user_input is empty assortment.
In line 222 it jumps to function _recaptcha_v3_verify_captcha_response(ReCaptchaV3ActionInterface $recaptcha_v_3_action, $captcha_response) where $recaptcha_v_3_action is initialized object only $captcha_response is empty.

It loads the secret, and in return jumps into verify() method where $response = "" and $remoteIp set. Discards empty solutions like comment in code says. In the end logs an mistake etc.

So information technology fails somewhere before that line 208.

dench0's picture

@milovan get-go of all on your screenshot y'all accept an empty captcha_response value, and then it can't exist verified in whatever way. You need to figure out why it is empty:
one. check the browser console errors.
ii. if absent-minded any errors, then cheque if yous take recaptcha token request and check response. See attached screenshot.

Also, it is strange why y'all having empty entire $user_input array or yous hateful that y'all have only empty $user_input['captcha_response'] value and all other values present in the $user_input?

milovan's picture

Browser console has no errors. I confirmed also that all required js loads properly.
I will give it another shot this weekend for $user_input every bit that might be a good clue.

dench0's picture

@milovan
I'thou thinking you don't understand me: before you will delve into $user_input issue, you need to figure out why your payload has empty captcha_response.
1. look once more to my screenshot #18 - there y'all can encounter that payload has not empty captcha_response value.
2. cheque your screenshot #19 - in your payload captcha_response value is empty.
3. If absent-minded any errors in your console, then you need to bank check if google token request is executing and if information technology has recaptcha token (see screenshot #20)
One more time:

I confirmed also that all required js loads properly.

is not plenty.
You need to go to the Network tab in the browser development tools, then find the POST asking to the google and check response. Pls check my screenshot more advisedly: there you will notice how to identify that Postal service request.

malagaonrails's picture

I was facing the same effect, only realized that it always occurs when I send the class before google recaptcha API response is available, so that captcha_response parameter is empty on the webform payload.
Yous tin check on the network when this response is bachelor by filtering by requests similar to:
https://www.google.com/recaptcha/api2/reload?k=...

This request may take a while, and then if you submit the form before it is done, or for any reason, the answer is empty or fails, information technology may happen that you won't be able to send that info to Drupal, and that it tries to apply the defined fallback.

Promise this help.

KarlShea's picture

I'm having the same issue, the response from google seems malformed?

                )]}' ["rresp","03AGdBq26Yr4cppiZ4G5AnxAv8sGrlxtDKEQ...                              

KarlShea's picture

Update: lowering the threshold from 1 to 0.ix besides fixed it for me.

KarlShea's picture

And this is the configuration change. Perhaps it's some result with parsing the 1 as a float?

                - threshold: !!float one + threshold: 0.9                              

ThirstySix's picture

Yep Same outcome.
if i change the threshold: 0.9 as mentioned @KarlShea information technology works well.

dench0's picture

@KarlShea and @ThirstySix it working fine with the threshold 1.0.
I attached the screenshot from the debugging: there you can see that used threshold is 1.0 and the validation result is score-threshold-not-met because of google scored my interactions every bit 0.9, then everything working equally it should.

dench0's picture

Status: Agile » Airtight (works as designed)