Closed pkarthik86212 closed 6 years ago
hi,
This is not supported, but I am pretty sure you can add multiple host name to the same sitekey
Thanks for your reply Paul. The problem for me is that an admin can create a new host and while creating a new host they wanted a new site key/secret key for security reasons.
I created my own custom method to validate the keys.
public async Task
if (string.IsNullOrWhiteSpace(recaptchaResponse))
{
this.ModelState.AddModelError("captcha", "Please confirm that you are not a robot.");
return false;
}
var httpClient = new HttpClient();
var httpResponse = await httpClient.GetAsync($"{RecaptchaRequestUrl}?secret={secretKey}&response={recaptchaResponse}");
if (httpResponse.StatusCode != HttpStatusCode.OK)
{
this.ModelState.AddModelError("captcha", "The reCAPTCHA is not valid.");
return false;
}
var jsonResult = httpResponse.Content.ReadAsStringAsync().Result;
dynamic jsonData = JObject.Parse(jsonResult);
if (jsonData.success != "true")
{
this.ModelState.AddModelError("captcha", "The ReCaptcha is not valid.");
return false;
}
return true;
}
Hi,
In my project I having multiple sitekey/secretkey pair for multiple hosts and I am not able to configure the keys from my controller