Rikk / recaptcha

Automatically exported from code.google.com/p/recaptcha
0 stars 0 forks source link

Proxy support missing in ASP.NET Recaptcha.RecaptchaValidator #49

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Call the RecaptchaValidator.Validate() method when behind a web proxy.

What is the expected output? What do you see instead?
I expect the API to support specifying an IWebProxy implementation. This
feature is missing.

What version of the product are you using? On what operating system?
ASP.NET 1.0.1.0

Please provide any additional information below.

Here's code to support this:

public class RecaptchaValidator {
    ...
    public IWebProxy Proxy { get; set; }
    ...

    public RecaptchaResponse Validate() {
        ...
        HttpWebRequest request =
(HttpWebRequest)WebRequest.Create(this.verifyUrl);
        request.Proxy = this.Proxy;
        ...
    }
}

Original issue reported on code.google.com by frank.l...@gmail.com on 1 Jun 2009 at 11:48

GoogleCodeExporter commented 9 years ago
Shouldn't this be automatically done by the runtime via configuration values?

Original comment by adrian.g...@gmail.com on 24 May 2010 at 9:07

GoogleCodeExporter commented 9 years ago
You would think so but there is no 'default' method provided to do this in the
web.config; in other words it's not possible to include a UID/PWD in the 
defaultProxy
or proxy elements. It is however possible to create a defaultProxy module class 
that
assigns credentials to the defaultProxy..

I think this becomes an issue where there is a proxy server inline that requires
authentication but the web application is running under a user account that 
cannot
authenticate e.g. NETWORK_SERVICE. 

I suppose it's possible to do the defaultProxy module class thing, or do what 
we did
in the end and impersonate in code early enough in the page lifecycle for the
impersonation to have effect before the RecaptchaValidator webRequest is 
attempted. 

If the IWebProxy does get surfaced in the reCaptcha ctrl, it probably just 
provides
another easier method to assign user credentials for the proxy server at runtime
(which can't be a bad thing).

Original comment by joe%jjss...@gtempaccount.com on 25 May 2010 at 3:33

GoogleCodeExporter commented 9 years ago
Noted. Will implement code change above later. Thanks.

Original comment by adrian.g...@gmail.com on 25 May 2010 at 3:38

GoogleCodeExporter commented 9 years ago
Implemented in r128.

Original comment by adrian.g...@gmail.com on 25 May 2010 at 3:47

GoogleCodeExporter commented 9 years ago

Original comment by adrian.g...@gmail.com on 30 Mar 2012 at 6:16