views:

289

answers:

1

Hello Guys,

I deployed my MVC application in our IIS server. When I go to registration page the recaptcha image is not showing. However, When I run it on Visual Studio its working properly. I'm using IIS 6.

Do you guys have any idea regarding this issue?

Best regards,

+1  A: 

Just a guess, but have you set up your public/private keys correctly?

From the recaptcha API docs

In order to use reCAPTCHA, you need a public/private API key pair. This key pair helps to prevent an attack where somebody hosts a reCAPTCHA on their website, collects answers from their visitors and submits the answers to your site.

Your reCAPTCHA token is valid only at the domain you sign up for and any subdomains (due to the potential attack mentioned above).

As for why it works in development, but not off your server:

If one of your servers is "localhost" or "127.0.0.1", reCAPTCHA will not enforce the same-domain rule. Just use the same key as for the production server.

... so even if you haven't set up your keys properly, the reCAPTCHA will still work if the page is being served from your local machine. Once you deploy though, and incorrect or missing key will prevent the reCAPTCHA from loading.

Daniel LeCheminant
Thanks for the reply. Though I haven't tried it yet but definitely your right.
samer