user4351771
user4351771

Reputation:

ZfcUser ReCaptcha v2

I wanna add ReCaptcha version 2 from Google to ZfcUser RegisterForm. I did as mentioned in Zend Framework 2: How to properly replace Figlet with reCaptcha on zfcUser and it works fine.

Then I added recaptcha of version 2 trough composer:

"browserlife/zf2-recaptcha"             : "dev-master"

Then I changed my zfcuser.global.php

'form_captcha_options' => array(
    'class'   => 'BrlReCaptcha\ReCaptcha'
    'options' => array(
        'expiration'=> 300,
        'timeout'   => 300,
        'theme'     => 'dark',
    ),
),

So, I get the correct register form on my page. The captcha (version 2) provides validation and successfully passes it. But from the server side I get the error that captcha element was is empty.

The difference is that these elements (v1 and v2) send various parameters for verification:

recaptcha v1 sends this params to server for processing:

captcha[recaptcha_challenge_field]
captcha[recaptcha_response_field]
recaptcha_challenge_field
recaptcha_response_field

recaptcha v2 sends this params to server for processing:

g-recaptcha-response

Who knows how to be? Perhaps there is another solution for integration the ReCaptcha v2 by Google.

Upvotes: 1

Views: 659

Answers (2)

malganis93
malganis93

Reputation: 1

I'm the developer of "browserlife/zf2-recaptcha" . Please check the readme file of this module: https://github.com/malganis93/BrlReCaptcha

If this doesn't solve your problem please contact me.

Upvotes: 0

Fergal Andrews
Fergal Andrews

Reputation: 314

I recently had to add the new nocaptcha recaptcha to a ZF2 application. After much time spent trying to integrate it the 'Zend' way, which was unsuccessful, I decided to just do it as per the instructions here (http://webdesign.tutsplus.com/tutorials/how-to-integrate-no-captcha-recaptcha-in-your-website--cms-23024), bypassing Zend's libraries and everything works correctly.

Upvotes: 0

Related Questions