Reputation: 680
I am integrating a reCAPTCHA to my site using ReCAPTCHA MVC it is working fine in my development machine but after deploying to production it always send false response. I followed all the steps correctly that are mentioned in the documentation of ReCAPTCHA MVC. and also configure my website url in domain list of Google ReCAPTCHA key settings.
My form is ajax based so that's i written my code as per MVC AJAX.
[HttpPost]
[ValidateAntiForgeryToken]
[AllowAnonymous]
[CaptchaValidator]
public JsonResult SubmitContact(ContactUs contactus, bool captchaValid)
{
if (!captchaValid)
{
return Json("Invalid captcha");
}
if (ModelState.IsValid)
{
//some impl.
return Json("Success");
}
else
{
//some impl.
return Json("Error");
}
}
captchaValid
always false in production but works fine in developement.
I am not found any luck.
Could any one please suggest what i am doing wrong.
Upvotes: 0
Views: 600
Reputation: 680
Problem resolved: I am getting always response false due to my requested site's certificate has expired.
Upvotes: 0
Reputation: 2797
May be because you registered localhost on registration. So it works on development and when you try to use same keys on your production, it doesn't!
Upvotes: 0