Add requester to recaptcha validation

This commit is contained in:
Moxie Marlinspike
2019-07-11 12:38:22 -07:00
parent 288285f22b
commit a6e7e30177
3 changed files with 7 additions and 6 deletions

View File

@@ -21,10 +21,11 @@ public class RecaptchaClient {
this.recaptchaSecret = recaptchaSecret;
}
public boolean verify(String captchaToken) {
public boolean verify(String captchaToken, String ip) {
MultivaluedMap<String, String> formData = new MultivaluedHashMap<>();
formData.add("secret", recaptchaSecret);
formData.add("response", captchaToken);
formData.add("remoteip", ip);
VerifyResponse response = client.target("https://www.google.com/recaptcha/api/siteverify")
.request()