peoplemerge / recaptcha4j

Automatically exported from code.google.com/p/recaptcha4j
1 stars 1 forks source link

reCaptcha4j is unable to hit a verify URL other than "http://api-verify.recaptcha.net/verify" #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
For a project I am working on, we need to go through a proxy to hit 
reCaptcha. Given Google's distributed architecture, I think this will be 
something many companies will need to start doing (since it is not 
desirable to open ports for all of Google's servers).

This is currently impossible because the recaptcha URL is hardcoded in the 
checkAnswer method of ReCaptchaImpl.

We are currently working on a workaround (subclassing ReCaptchaImpl), so 
that the recaptcha verify URL is taken from configuration. I think this 
should be in the official jar as well.

What version of the product are you using? On what operating system?
0.0.7, OS=Windows and Linux (the issue is not OS specific).

Code snippet of the current, official solution:

        String postParameters = "privatekey=" + 
URLEncoder.encode(privateKey)
                + "&remoteip=" + 
URLEncoder.encode(remoteAddr) + "&challenge="
                + URLEncoder.encode(challenge) + 
"&response="
                + URLEncoder.encode(response);
        String message = httpLoader.httpPost(
                "http://api-verify.recaptcha.net/verify", 
postParameters);

Original issue reported on code.google.com by ltsi...@gmail.com on 6 May 2010 at 3:28

GoogleCodeExporter commented 9 years ago
Im having the same problem, does anybody have a solution? Cheers.

Original comment by swinO...@gmail.com on 10 May 2010 at 4:41

GoogleCodeExporter commented 9 years ago
String VERIFY_URL = "http://www.google.com/recaptcha/api/verify";

Changing the VERIFY_URL for the new one (google's one solves the problem.

Original comment by swinO...@gmail.com on 10 May 2010 at 5:58

GoogleCodeExporter commented 9 years ago
It would be preferrable if at least one method of injection were provided; a 
setter, a constructor argument, or even making it protected member variable 
would at least provide some flexibility without having to make direct 
modification to the provided package.

Original comment by mrand...@cerner.com on 4 Aug 2010 at 2:15

GoogleCodeExporter commented 9 years ago
fixed in svn 0.0.8-snapshot

Original comment by sorentan...@gmail.com on 19 Sep 2010 at 7:51