I Continue to Receive an Error Stating That I Have Submitted an Incorrect Captcha Value
Hi all,
I am using this module with the dev version of recaptcha module. I have entered the V3 site and secret key successfully. And then added the V3 action to a webform. Yes, I am getting the V3 site key in 'view page source'. But when I submitting the webform I am getting an error like "The answer you entered for the CAPTCHA was not correct.". And when I again refresh the page then I am getting V2 recaptcha there.
Support from Acquia helps fund testing for Drupal
Source: https://www.drupal.org/project/recaptcha_v3/issues/3025955
Comments
Hi,
Can you pls provide to me screenshot of the recaptcha v3 settings page? Also it will be handy if you will look to the browser console to see if any errors appears there.
Comment #3
sokru Credit Attribution: sokru as a volunteer commented
I have same issue. I use v3 reCAPTCHA for webform that is rendered as block. In reCAPTCHA v3 settings are same in project page screenshot and in Google settings I have checked "Verify the origin of reCAPTCHA solutions". I'll hit the error only if its going to fallback (settings threshold to 1), so I wonder if this is `recaptcha_v3` or `recaptcha` or `captcha` module issue? Anyhow thanks for the work with this module so far and I hope we can resolve this issue!
I guess the issue is that if the v3 reCAPTCHA fails it does not rebuild the form, so it submits form with reCAPTCHA captcha instead of preventing the form submit and displaying fallback captcha.
I can only assume my issue is related to this one.
This is on the login page (/user/login)
I'm unable to login to the site without first disabling recaptcha_v3 through drush.
Regarding the
Warning: strtr(): The second argument is not an array in syslog_watchdog() (line 115 of /home/user/public_html/modules/syslog/syslog.module).I'm guessing this is because I have watchdog disabled... There should first be a check to see if watchdog is enabled.Figured out I had the "Challenge type" set wrong... I would like to recommend that the "Challenge type" is renamed to "Fallback Challenge type"
Once I set the Challenge type to "recaptcha" (I was setting it to the action) I began getting the v2 fallback challenge in addition to the error: The answer you entered for the CAPTCHA was not correct.
This will allow login now after the first v3 recaptcha failure.
Now I understand what's is bothering you: the error message from the fallback widget. In the current implementation, validation of the recaptcha v3 occurs in the element #process function - it is executes before the validations. If it fails, the recaptcha widget is replaced by fallback and fallback validation executed - that is why you see errors from the replaced widget. I don't remember why I'm done in this way, instead of triggering form rebuilding for replacing capcha widget. Next week I will look again and try to change this behavior.
Not sure if the attached screenshot will help. The main captcha default is to use the recaptcha_v3 action I setup. (the forms that are actually enabled for captcha are below the screenshot, set to use the default captcha method)
So, Captcha default = recaptcha_v3 action
Recaptcha fallback default = recaptcha v2
Ideally, recaptcha_v3 should be setup with 2-3 actions IMO.
high spam score with fallback to low spam score
low spam score with fallback to recaptcha v2
Unfortunately, I can't get recaptcha_v3 to work at all :-/
Comment #9
jddh Credit Attribution: jddh as a volunteer commented
I also cannot hit a successful submission without falling back to the challenge — only asking for 0.5 score.
Agree that this could be improved in the short term by changing fallback validation execution timing so that there is a more accurate error message. I think the message would be ideally surfaced in the admin form, as the particular wording might be altered to suit audience.
Hi everyone and sorry for my silence. I'm added settings for error message text.
Now if recaptcha v3 verification fails, it working like this:
So now it should display custom error message instead of the error message from the fallback challenge.
Some notes about error message 'The answer you entered for the CAPTCHA was not correct.':
it is impossible to replace it, without completely replacing default captcha element validation function. So this part leaved unchanged, because in my opinion it is better to change the text of the error message to a more neutral one, something like this: "Antibot verification failed."
To change captcha error message you can use one of this solution:
@dench0 Thx for the changes :-) Any ideas why it is "always" failing or did you manage to get that sorted out too?
@philsward I'm thinking you having wrong configuration of the captcha. On your screenshot for each form selected "- No challenge -", so it is not generating captcha form element at all. You need to change select value to the "Default challenge type". If this will not help, then pls check your browser console and dblog for any related to the recaptcha v3 errors.
@dench0 thx for the suggestion, I'll check it out and report back when I get some time to mess with it.
I have same issue.
Turned on logging wrong responses in CAPTCHA settings page.
In the log this line appears after failled verification:
post blocked by CAPTCHA module: challenge alap (by module recaptcha_v3), user answered "Google recaptcha v3", but the solution was "1".@csip pls show screenshots of the settings pages of the captcha and recaptcha v3. Also check if exist any errors in browser console when you trying to submit form with recaptcha v3.
Yeah, I still can't get this to work with alpha2.
What I expect the workflow to be, are steps through the score with each failure moving to the fallback. If this is not how the module is designed, then please explain how it is supposed to work.
Expected Workflow Example:
So a form would have the Relaxed captcha from v3 as it's default mechanism. If that fails, it should pass to the Secure_Score mechanism on a subsequent submit. If that also fails, it should fall back to the v2 reCaptcha mechanism.
Is this correct? Can it work this way? Is it designed to work this way? There's nothing in the documentation that really explains the expected setup for v3 other than entering the keys and setting up the actions. The problem with the documentation is no outlined workflow. Maybe the next example is the intended workflow?
Possible Workflow Example:
In this example, one form uses a relaxed score, maybe a webform used after user authenication. The second form would maybe be used on anonymous facing form pages. In theory, both examples "should" work.
This module shouldn't be this difficult to figure out considering there is only a single page to configure, but either it's buggy and has never worked for me or I am clueless to the proper setup.
The answer you entered for the CAPTCHA was not correct.
this is my site error in exposed views drupal
Ive used "Im not robot" recaptcha
the recaptcha work well in login... but not work in exposed views drupal
Just wanted to leave my 5 cents: I had the pleasure to integrate the recaptcha_v3 module today in an existing site of our clients. An initial error as described in this thread prevented us from successfully sending any form secured with reCaptcha v3.
A look into the browser's console revealed a JS error. It wasn't directly related to this module. In fact, jQuery was included twice (default by Core and additionally a much newer version by the custom theme). The theme's jQuery overwrote the Core version, resulting in
jQuery.once()not having been available.Fixing the JS errors by removing the theme's jQuery and using jquery_update instead for having a newer version of jQuery in the theme did the trick.
Everything is working as expected now.
You might wish to check, whether your JS is free of any errors and/or triggering the v3 API is prevented by any JS issues with your site.
The problem for me seemed to be that I had named the action 'RecaptchaV3'. As soon as I changed the action name to all lower case letters I stopped receiving this error. It seems that having a number in the action name will break the validation logic for some reason.
Not working for me, always falls back to V2. I can see the correct v3 logo bottom right but I get "The answer you entered for the CAPTCHA was not correct."
I think I set it up ok but I get this in the log:
reCAPTCHA web service Not a success, but no error codes received!
EDIT:
Tried on 3 websites now and not working - sorry but I don't see how this module is usable...
@kevster Can you, please, check your browser console for existence of the any js errors?
@dench0 - sorry for the delay in replying. When I load the webform I get this in the console:
Uncaught TypeError: $(...).once is not a function
at Object.attach (recaptcha_v3.js?q80dfn:8)
at Object. (drupal.js?q80dfn:112)
at Function.each (jquery.min.js:2)
at Object.Drupal.attachBehaviors (drupal.js?q80dfn:110)
at HTMLDocument. (drupal.js?q80dfn:593)
at e (jquery.min.js:2)
at t (jquery.min.js:2)
I just get this message and falls back to v2 tickbox?
The answer you entered for the CAPTCHA was not correct.
Im running Drupal 7.69
jquery update with default jquery 3.4, google jquery CDN, jquery migrate enabled with jquery CDN
If I use v3 as the fallback I get this:
Recaptcha verification failed.
The answer you entered for the CAPTCHA was not correct.
EDIT:
from the log
with v2 fallback
webform_client_form_38 post blocked by CAPTCHA module: challenge reCAPTCHA (by module recaptcha), user answered "Google no captcha", but the solution was "1".
two attempts with v3 fallback
webform_client_form_38 post blocked by CAPTCHA module: challenge verify (by module recaptcha_v3), user answered "Google recaptcha v3", but the solution was "387e4b4d7d058dcc0706c2c3aa12f63a".
webform_client_form_38 post blocked by CAPTCHA module: challenge verify (by module recaptcha_v3), user answered "Google recaptcha v3", but the solution was "872437566a5e34168c13d66f4dfd0110".
Same problem
user answered "Google no captcha", but the solution was "1"
Is this problem exist with the latest dev version?
I'm seeing the same issue. Log says the answer was "Google no captcha", but the solution was "1".
@greenSkin Are you using the latest dev version?
Yes. I tried with v1.2 and the latest dev. It's the fallback to the recaptcha module where I'm seeing this issue. When I use recaptcha (v2) directly it submits just fine. But using v3 where the action fails and triggers the fallback to v2, the verification gives the previously mentioned error in the logs. I should note the v2 checkbox shows on the form just fine, and when clicked checks. It's when I submit the form that it errors and fails.
Ok, thanks everyone - I found the problem and attached patch.
I am using the latest version of this module, but still get the exact same error.
The patch #28 did not install on my side.
All 9 sites are experiencing the same problem.