Recaptcha works locally, but not in production - asp.net

I followed the instructions on how to add Recaptcha to my website (asp.net 4.0, Visual Studio / VB. When I run the page locally, which is just a simple contact form page that sends an email, the recaptcha thing shows up fine. I am NOT a programmer, though.
When I move it to production -- and I move the website (and the dll and pdb to the app_code folder and the bin folder, which Visual Studio created on its own), the page won't just refreshes and never sends an email -- and it doesn't matter if you type the right or wrong thing in the recaptcha textbox. Without the recaptcha code, the contact.aspx page functions normally and sends the email instantly.
But the recaptcha box is there. I've read things about handler mappings in IIS and my web.config, but I'm not intelligent enough to understand if I have to do anything or not, and what to do. I also have IIS 7.0 on here.
UPDATE:
When you enter the recaptcha information in the text box properly, the page displays the confirmation I encoded, and sends an email. When you do NOT enter the recaptcha info correctly, instead of sending a "Please try again" message, it just refreshes the page and makes them start all over again. It does not say "Please Try again" and doesn't leave the client with knowledge that they mistyped the code

Are you using the reCAPTCHA ASP.NET control with the Recaptcha.dll?
You need to have signed up for the service with a domain name. The public and private keys you receive are checked against this domain:
reCAPTCHA will only work on this domain and subdomains.
Notice it the admin page screenshot below:
But this rule does not apply on the localhost domain, which is what you use when developing with Visual Studio. So it may be that you are not using the keys that you received when registering your domain. When you select the control and switch from design view to code view in Visual Studio the control code should look like this, with the keys:
<recaptcha:RecaptchaControl ID="recaptcha" runat="server"
PublicKey="6Lexn8wSAAAAAIfH1c3-6K3FbSjcKdMj3uiMImI7"
PrivateKey="6Lexn8wSAAAAAKRFTJXTudJN1owrIQMDahwYv0hg" />
If not, you have to enter your keys. This is just an example, don't use these keys, use the keys displayed in your own account for your own domain.

Related

Website shows textbox in debugger but not when hosted w/ISS ASP.NET

I've been tracking to tackle this issue and narrowed it down, but first a little description:
I have a website that a client would fill out, some basic text boxes, bullets, and dropdowns. They click submit and the information they submitted (nothing sensitive) is Response.Redirect(ed) to another page which has text boxes that are populated by the information included in the redirect. This page also prints itself for the client to sign.
The issue started when I added one more field to the redirect page so that it appears as well when printed. It simply does not appear on the page or the print out and I cross-checked the properties with all the other textboxes and everything is the same. Now, I did narrow it down in that the new textbox does appear when using the built in debugger for MS Visual Web Dev 2010 Express but it does not appear when I host the website on the local IIS server. From here it seems to be obvious that the issue is a setting on the IIS service.
To the question: What setting in IIS would cause a newly added textbox to not appear under the circumstances mentioned? Also, am I approaching this website as a whole in a round-a-bout way i.e. instead of redirecting to another website the populates data, prints itself, and redirects back to the host page is there an "internal" form I can have the data sent to and print from there?
The issue was that I setup the ISS server/website under and an administrator account with the website being under a folder on the desktop. I overlooked this fact and copy/pasted the website folder to the desktop of a different non-administrator account and so naturally none of the changes were actually showing because IIS wasn't even pointing to that website folder of the non-admin account. Once I dumped the modified files under the proper folder under the admin account they finally appeared in production.

Asp.net IIS7 keep prompting user credentials for non admin users

I have an ASP.net website which is set to operate on Windows Authentication. It runs on IIS7 with windows authentication on. Every user who isn't from administrator group, Internet Explorer keep prompting for user credenials. Though when user clicks on cancel, the web site runs ok as long as user does not click on any page control.
I have a master page with telerik controls on it. This page contains AJAX Manager and ScriptManager. If user call an aspx page without master page, the credential windows doesnt appear.
Telerik resources are registered in web.config..and as I said the website works without problem for admin group. Normal users are also from the same domain..but for them login windows keep coming...
any idea?
The website is not registerd under trusted intranet sites..but this shouldnt be a problem as otherwise admin should also get error message.
Regards
I am answering my own question as it might be helpful for others too.
I was finaly abled to track down the issue with the help of Process Monitor. http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx
It turned out that one of the CSS file didn't have enough permissions for normal users.

Prefill form elements and post

We have third party applications I need to link from my application. Where for those third part web sites I have user name and password with us (They are public websites). When the user click on those links we need to prefill user name and password and submit the form. Like single sign on kind of experience for the user. Is anyone tried doing this how we can do it. We need to open the web page with in Iframe or with in DEV ?
ASP.NET, Jquery and Java Script our platform.
I ended up getting the login page into my project and towards the end with jquery I posted the form filling the the user name and password. Not good solution but it works well

Anonymous Authentication in IIS over https does not fire a postback

I recently decided to change from using Windows Authentication for my internal web applications to Forms Authentication. I've not used the latter very much and one site explained you have to enable both Forms and Anonymous for this to work. The idea is to verify user passwords against an active directory then grant them access accordingly. I had this working just fine locally and when publishing to IIS 7.5 it still worked. It was just a basic Visual Studio project that would redirect to our homepage.
The problems arose when I tried accessing this same project securely with https, I included the full domain and it would load the new login page but when I clicked login it would do nothing. Since then I've scoured the web and found numerous mentions of this and that and tried many of them to no avail.
It was only later I created a blank project with a single button and one line of the code on the page to see if a post back had fired. After publishing I only enabled Anonymous Authentication in IIS and browsing to this basic test app using http when you clicked the button, false on the page changed to true - indicating a post back. Yet with https it just remains false. I think this may be why the active directory login wasn't working as it too had Anonymous enabled.
I'm still pretty new at the secure side of things but with the details passing over I have to use a secure connection just for the login then it can redirect to the usual applications we use internally.
I'd appreciate any thoughts you may have regarding this.
Thanks!
We use this configuration (anonymous IIS access, forms authentication, and https) successfully all of the time.
There are three things that you should do to track this issue down:
1) Verify that there are no javascript errors in the page that break the button (i.e. a javascript file not being delivered to the page)
2) Check the windows event logs for exceptions from asp.net/iis.
3) Install and run fiddler, select Fiddler Options... from the Tools menu, click on the HTTPS tab and ensure all of the checkboxes are checked, then run your website and look at the requests and responses, particularly when you press the button.

Prompts for windows authentication when viewing a page in Web site

When i try to view a PARTICULAR page in my web site, it prompts for user name and password. Irrespective of providing proper user name/password and clicking OK or directly clicking Cancel button, the page is getting loaded properly. I am not sure why the authentication screen appears!!! It happens only for that particular page. Initially I thought it could be with file permission but copy pasted another page (which works fine) and renaming it doesn't solve the problem. Thoughts pl.
EDIT
I copied the source from the browser for that particular page and saved it as HTML. When i try to open the HTML file, it prompts for authentication.
Solution
I disabled the Integrated Windows Authentication in IIS and it works fine.
It's because some content is linked to a page that requires that (i.e. an image or a css file or a JavaScript file). Find out what it is, and make sure the link is correct.
Disabled the Integrated Windows Authentication in IIS and it works fine

Resources