Enable SSL for ASP .NET Site - asp.net

I am trying to enable SSL on one of my ASP .NET Web Site.
While doing so I am performing below two steps.
After doing above two settings if i try to browse site I should see below two popup.
But I am not getting above two popup instead I am getting below message on IE.
This page can’t be displayed
Make sure the web address https://localhost:2698 is correct.
Look for the page with your search engine.
Refresh the page in a few minutes.
Note: Please ignore PortNumber I have taken screen from other website.

If they don't appear, then you've probably clicked "Don't ask me again", and VS is doing exactly what you asked it to do - not ask you.
You can reset that by editing the registry and removing
HKCU\Software\Microsoft\VisualStudio\12.0\WebProjects\HideTrustIISCertificatePrompt
Then when you restart VS and attempt to enable SSL on your project you should be prompted again.

Related

How to stop Windows Security popup for Sharepoint 2007 site with anonymous access enabled

I've been researching this a lot lately and cannot seem to find a solution to the exact problem I'm having, so I figured I'd ask and get any help I can get.
Here's the scenario: I took over a Sharepoint web application that was in development for a client. I finished adding the rest of the content for him and he wanted to go live with the site once I finished. I am wanting to make the entire web site (web application) public so I completed the steps to allow anonymous access for the entire web site.
The problem I'm encountering now is that every time someone goes to the site, it pops up with a window asking for the username and password. When you cancel it, then the site pops up as it should and you can view anything on the site. However, each time you click to go to the Home page (default.aspx), it pops up with the Windows Security again. Basically you can view the whole site as intended without logging in, but the popup happens each time going to the default.aspx page to where you have to keep cancelling to continue viewing the site. Of course this needs to stop since the site will be public for users and many do not have a log in. This obviously will confuse people trying to see the site because they'd think they need to log in.
Does anyone have some suggestions to why this is happening and how to stop it? None of the other Sharepoint sites we've made have had this issue when enabling anonymous access so it's not an issue we've come across before. I've looked at the other sites and how they're set up and it looks identical to this site that is having the popup issue. There's also not been a need before to adjust IE Internet Option settings since that was one solution I've seen.
Any help would be appreciated. I've tried researching and couldn't find a solution I needed and I'm at a loss. I can provide any additional info if needed. Thanks!
This can happen (and most probably) if a resource is not published in your site. Make sure to publish all your resources (Images, CSS & JS files.. etc) and then give it a try.

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.

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.

ASP.NET Development Server 403 Error

I'm developing a web application in Visual Studio 2010 on Win 7, and now seem to have a new error that has just popped up. When I try to access the site which uses Windows Authentication, in Firefox, I get a 403 error, with no subcodes. Up until this poijnt, it has been working this way just fine. Firefox prompts me for my credentials, and I enter them and then I get the 403 error. No problems with it in IE, just Firefox.
I've checked the network-trusted-ntlm-automatic key in Firefox and deleted my session cookie, but still no luck. The problem seems to be limited only to Firefox.
If I set the app to be Anon access, it works with no problems, but the app needs to be Windows Auth.
I attempted Local IIS, but there wasn't an option for Windows Auth for the app on my local IIS, so that kind of removed that option for the time being.
Any ideas out there for how to get this working correctly again? I'll take answers that get me the Windows Auth option in my local IIS as well, because that would also fix the problem for me.
Check to make sure directory browsing is not enabled for the site. Also, make sure your default documents are setup so when you go to: http://www.yoursite.com/ (notice the slash at the end of the url) a default document is loaded. I have seen in some cases where IIS thinks you want to browse the directory rather than load a page. See if you still get the 403 error by going to a specific page.
I'm running windows 7, 64bit with IIS 6.1.
To turn on Windows Authentication, go to Control Panel -> Administrative tools and select IIS Manager.
In the left panel, expand Sites, Default Web Site, and select your Virtual Directory. You should see Asp.Net in the top panel and IIS in the middle. The first icon under the IIS section is Authentication, double click this. You can then disable annon and enable windows by selecting from the drop down list and clicking Enable / Disable from the actions on the right side of the page.
Hope this helps.
After some digging I finally found the answer, but it wasn't where I expected it.
I was digging through Event Viewer trying to figure out why I kept getting Account Lockout messages when trying to load the site with Firefox and did some searching came across an article that specified how to add multiple servers to the Firefox network.automatic-ntlm-auth.trusted-uris key in about:config.
I had specified:
http://host1; http://host2
and instead should have separated with commas
http://host1, http://host2
I changed it to commas and reloaded and it is now working correctly with the Windows Authentication in Firefox.
Hopefully someone else finds this particular fix useful. Small typo, big headache.

Authentication dialog when running with Visual Studio web server

When using Visual Studio's built in web server, every time I make a page request the standard login box pops up and asks for credentials. It doesn't work if I actually put in my credentials, so I just have to hit cancel 5 times so it will go away.
When I run the application through IIS (locally or on test server) it works just fine (no login box comes up).
Anyone know how to fix this or have any idea what might be causing it?
I assume you mean JavaScript alert box-looking login dialog, right? This dialog pops up when you make a request to a portion of website where anonymous access is disabled from IIS. It is different from ASP.NET authentication.
Do you have some portion of web site protected? Or are you making any HTTP request to external sites, like images and etc?
If your page looks ok after hitting cancel multiple times, it must be one of those HTTP request to protected file like images, css, js or whatever.
I'd look in Fiddler or Firebug to see if any request is failed when you hit cancel in that login dialog.
I'd also try clearing cache/authenticated session on the page that runs on IIS to see if it actually shows you that login dialog.
I had this same issue. However, my solution was different and the issue seemed different as well.
I had been working on a ASP.NET 2.0 web application, using VS 2008. Everything was working fine with the built-in IIS server. I hadn't opened this project for about a week and then when I chose "View in browser" in VS, I was prompted for my windows login creds. This project never did this before, so I was a bit baffled. I checked all the web.config settings and everything seemed fine. My project settings seemed correct as well. I decided to test the project by opening this same project in VS on a separate dev box on my network using a network path. I again chose "View in browser" and it worked fine. No logon prompt.
This told me that the issue wasn't with the actual web project itself, rather my dev environment. I checked all my browser settings as suggested above, and they were correct. I then compared my project settings while I had the same project (same physical files) opened in both dev boxes. I noticed a difference...
Under the Start Option in the Property Pages, the Web Server was set to use the Default Web server in both cases. However, on the box that was asking for my creds, the NTLM Authentication checkbox was selected. I unselected this and it resolved the issue.
I'm not sure how this was possible since I was opening the same project files, and would assume the project settings would be exactly the same. And the fact it was working fine a week ago really perplexed me. I chalked it up to an issue with VS 2008 on the box with the issue. I hope this helps anyone else that may be running into this issue.
This was because localhost was not in my trusted sites so it wouldn't do automatic NTLM authentication... I'm not sure why it was that way, but it was... adding localhost to the list fixed it.
In your project, there should be a vwd.webinfo file.
The following lines control authentication when debugging (in IISExpress). Set as follows to avoid all dialogs.
<VisualWebDeveloper>
<iisExpressSettings anonymousAuthentication="enabled" windowsAuthentication="disabled" useClassicPipelineMode="false"/>
</VisualWebDeveloper>
If windowsAuthentication="enabled" you may still get a dialog, even if anonymousAuthentication="enabled" :-)

Resources