Page 1 of 1

Error ReCaptcha V2

Posted: Tue Jul 07, 2015 4:08 pm
by bastiaan.c
Hi, I do not understand how to use the ReCaptcha V2

Google give me a Site key and a Secret key
MFH is asking for Public key and a Private key

Image

Image

Image
What do I do wrong?

Thanks

Re: Error ReCaptcha V2

Posted: Tue Jul 07, 2015 11:10 pm
by mkoch227
Site key = Public Key
Secret Key = Private Key

In HESK, copy and paste the value shown under "site key" into the public key field and enter the value under "secret key" into the private key field. Also ensure that the reCAPTCHA created is set to the same TLD as your helpdesk's TLD (for example, if you helpdesk is at http://www.example.com/helpdesk, your TLD for your reCAPTCHA should be http://www.example.com)

Re: Error ReCaptcha V2

Posted: Wed Jul 08, 2015 4:16 pm
by bastiaan.c
Hi Mike, I tested all you wrote very precise and it did not help yet :-(

BTW I am not allowed to fill in this at Google: www.example.com/support

Although it says a green V it says:

Code: Select all

 Error: Please correct the following errors:

    Incorrect SPAM Prevention answer, please try again.
after submitting

Re: Error ReCaptcha V2

Posted: Sun Jul 26, 2015 11:20 pm
by Hairball
I'm having exactly the same issue.

Are you behind a proxy or firewall or something blocking?
I cant see anything in my apache logs that would point to an issue.

I'd really like to implement v2 but cant get past this issue.

Re: Error ReCaptcha V2

Posted: Sun Jul 26, 2015 11:32 pm
by mkoch227
Some users have issues since the v2 ReCaptcha lib that is included in HESK only supports file_get_contents, which is restricted in some PHP installations. A workaround that is planned to be included in HESK v2.4.0 is to add cURL support. You can try downloading this version of recaptchalib_v2.php at https://raw.githubusercontent.com/mkoch ... lib_v2.php and replace your existing file, which is located at /inc/recaptcha/recaptchalib_v2.php

Re: Error ReCaptcha V2

Posted: Thu Oct 08, 2015 3:19 pm
by FormidableMulk
I'm running into the same thing with HESK v2.6.5 & Mods for HESK v2.42.

Was this issue resolved in 2.4 as planned? (I ought to check the change log; I haven't yet.) If not, could you repost the cURL-based solution of recaptchalib_v2.php? I tried to pull it down and from your raw.githubusercontent.com, but it looks like the file has been removed.

Re: Error ReCaptcha V2

Posted: Thu Oct 08, 2015 5:04 pm
by mkoch227
The issue was resolved in Mods for HESK 2.4.0. Here's the link to the raw file: https://raw.githubusercontent.com/mkoch ... lib_v2.php

Re: Error ReCaptcha V2

Posted: Wed Oct 14, 2015 2:43 pm
by FormidableMulk
Hmmm... I've got a clean install of HESK 2.6.5 paired with Mods for Hesk 2.42, but I'm still running into this error.

Code: Select all

<div align="left" class="alert alert-danger">
<b>Error:</b> Please correct the following errors:<br><br><ul><li>Incorrect SPAM Prevention answer, please try again.</li></ul></div>
The reCAPTCHA iframe displays in the Security Check block, let's me validate that I'm not a robot, and then at form submission, I'm taken back to the ticket submission page with the error above. PHP logs the following events:

Code: Select all

PHP Notice:  Use of undefined constant error - assumed 'error' in inc\recaptcha\recaptchalib_v2.php on line 154
PHP Notice:  Use of undefined constant codes - assumed 'codes' in inc\recaptcha\recaptchalib_v2.php on line 154
PHP Warning:  Missing argument 2 for hesk_removeAttachments(), called in submit_ticket.php on line 408 and defined in inc\attachments.inc.php on line 125
PHP Notice:  Undefined variable: isTicket in inc\attachments.inc.php on line 130
$remoteIp and $response are defined when I call the verifyResponse method. curl_init exist.
When I comment out the cURL fetch (lines 95-113 of inc/recaptcha/recaptchalib_v2.php) and rely on file_get_contents, it works.

Re: Error ReCaptcha V2

Posted: Wed Oct 14, 2015 5:09 pm
by mkoch227
FormidableMulk wrote:

Code: Select all

PHP Notice:  Use of undefined constant error - assumed 'error' in inc\recaptcha\recaptchalib_v2.php on line 154
PHP Notice:  Use of undefined constant codes - assumed 'codes' in inc\recaptcha\recaptchalib_v2.php on line 154
What happens if you change $answers [error-codes] on line 154 to $answers['error-codes']? I doubt it will make a difference, but it's worth a shot since the "error-codes" should be surrounded in tick marks.

Re: Error ReCaptcha V2

Posted: Wed Oct 14, 2015 8:39 pm
by FormidableMulk
What happens if you change $answers [error-codes] on line 154 to $answers['error-codes']?
2 events instead of 4; it resolves the two PHP notices about the $answers array, but the captcha still doesn't validate via cURL. :(


Remaining notices:

Code: Select all

[14-Oct-2015 15:31:03 US/Central] PHP Warning:  Missing argument 2 for hesk_removeAttachments(), called in submit_ticket.php on line 408 and defined in inc\attachments.inc.php on line 125
[14-Oct-2015 15:31:03 US/Central] PHP Notice:  Undefined variable: isTicket in inc\attachments.inc.php on line 130

Re: Error ReCaptcha V2

Posted: Fri Oct 16, 2015 7:11 pm
by Klemen
The notices are unrelated errors. Does reCaptcha show with this file (upload to "inc/recaptcha")?
http://hesk.com/extras/recaptchalib_v2.zip

Re: Error ReCaptcha V2

Posted: Mon Oct 19, 2015 3:31 pm
by FormidableMulk
Klemen wrote:Does reCaptcha show with ... http://hesk.com/extras/recaptchalib_v2.zip
I am able to submit a ticket using this reCAPTCHA library. I'll roll with your version instead using my cURL-bypassing tweak.

Thanks!

Re: Error ReCaptcha V2

Posted: Mon Oct 19, 2015 4:10 pm
by Klemen
Glad to hear it. This one will be included by default as of HESK 2.6.6

Re: Error ReCaptcha V2

Posted: Mon Oct 19, 2015 4:12 pm
by mkoch227
So what exactly needed to be changed? All I noticed was that the SSL verification was disabled. Regardless I'll update the recaptchalib as well in the next Mods for HESK release (unless HESK 2.6.6 is released first ;) )

Re: Error ReCaptcha V2

Posted: Mon Oct 19, 2015 5:41 pm
by Klemen
Yes, the trick is in disabling the peer verification.

It's not the best solution, but so many hosts out there have problems with it and trying to explain the issue to their support staff ("it's the script's fault") and getting it fixed by updating certificates on the server can be a nightmare.