Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validation.captcha #24

Closed
felixlandicho opened this issue Sep 23, 2015 · 20 comments
Closed

validation.captcha #24

felixlandicho opened this issue Sep 23, 2015 · 20 comments

Comments

@felixlandicho
Copy link

Hi,

Why do I receive this error? even if the noCaptcha is a green check.

"g-recaptcha-response" => array:1 [
0 => "validation.captcha"
]

Thanks

@anhskohbo
Copy link
Owner

I'll check and reply you soon

@d3rd4v1d
Copy link

I have same issue.

@Lotuashvili
Copy link

@anhskohbo I have the same issue, please answer :)

@lehnen
Copy link

lehnen commented Dec 18, 2015

Same for me.
I run it under Homestead witch success. On my provider (Hosteurope) the same code fails with above message.

@Lotuashvili
Copy link

@lehnen I had incorrect secret key copied in my configuration file, please double check :)

Good luck

@lehnen
Copy link

lehnen commented Dec 18, 2015

@Lotuashvili Nice quick answer ;)
I checked the keys and they are identical on both sides. Also both domains are mentioned in Googles reCapcha console as valid for the keys.

@lehnen
Copy link

lehnen commented Dec 19, 2015

Fix for me: I wanted to use ReCaptcha, not NoCaptcha. Since the documentation of reCaptcha states to use POST parameter for validation (https://developers.google.com/recaptcha/docs/verify#api-request) I implemented it by myself, based on this code. I used Guzzle to make a POST request instaed of the GET request used by the original code an it works.

@nhtua
Copy link

nhtua commented May 29, 2016

Maybe you are trying to validate one recaptcha's response twice (when resubmit form). Every result key is one-time used.

@anhskohbo
Copy link
Owner

Fixed with latest commit.

@Tarasovych
Copy link

Tarasovych commented Apr 22, 2018

@anhskohbo Still same issue.
I get validation.captcha in both situations:

  • having non-valid NOCAPTCHA_SECRET, valid NOCAPTCHA_SITEKEY
  • having valid NOCAPTCHA_SECRET, non-valid NOCAPTCHA_SITEKEY

May this error being caused by non-https request to recaptcha api (I'm on local now)?

Can I set custom validation message for this case?

@Tarasovych
Copy link

Anybody here?

@mpge
Copy link

mpge commented Sep 13, 2018

Can confirm, I receive this as well with the current version.

@Tarasovych
Copy link

Still have a problem too.

@mpge
Copy link

mpge commented Sep 13, 2018

Checked my secret/private key, turns out Google for whatever reason reset the key on me.

Maybe check that.

@bikify
Copy link

bikify commented Jul 29, 2019

still getting this issue with laravel 5.8.

i was using this from documentation

$validate = Validator::make(Input::all(), [
	'g-recaptcha-response' => 'required|captcha'
]);

then i changed it to this

$validate = Validator::make(Input::all(), [
	'g-recaptcha-response' => 'required'
]);

according to stackoverflow and it worked liked charm.

@khairulhasanmd
Copy link

@iwaqarhussain
I can confirm, that works. Thanks.

@mpge
Copy link

mpge commented Jun 23, 2020

@iwaqarhussain
I can confirm, that works. Thanks.

I'm assuming this effectively just removes the validation for the captcha - hence, if the captcha is invalid/not correctly filled, it won't actually throw an error which is entirely the point of the captcha.

Not sure i'd reco this.

@bikify
Copy link

bikify commented Jun 23, 2020

@iwaqarhussain
I can confirm, that works. Thanks.

I'm assuming this effectively just removes the validation for the captcha - hence, if the captcha is invalid/not correctly filled, it won't actually throw an error which is entirely the point of the captcha.

Not sure i'd reco this.

No, that's not the way this works.

It do what it's supposed to do

@mpge
Copy link

mpge commented Jun 23, 2020

@iwaqarhussain
I can confirm, that works. Thanks.

I'm assuming this effectively just removes the validation for the captcha - hence, if the captcha is invalid/not correctly filled, it won't actually throw an error which is entirely the point of the captcha.
Not sure i'd reco this.

No, that's not the way this works.

It do what it's supposed to do

You may get client side validation on behalf of google, but in terms of your own actual server side validation, if you have no other code to validate the captcha, it will not be validated on your end (server side) AFAIK.

If you don't use the "captcha" rule, the function verifyResponse will not be hit. verifyResponse is the function that effectively checks with Google to ensure that the token provided through the post requests matches and is valid.

There should be another solution other than simply removing the rule all-together. Otherwise your captcha may not be solid.

You can see that someone commented below on the solution on StackOverflow.

@nasirkhannstu
Copy link

Please dont use this:
'g-recaptcha-response' => 'required'

Use this format:
'g-recaptcha-response' => 'required|captcha'

Check your API Key AND settings in Console. It should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests