Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Authentication not working for classic ASP pages (but does work for ASP.Net pages w/in same site)

We have an IIS7 intranet site running under integrated pipeline that is mostly ASP.Net with a few legacy classic ASP pages. The site allows anonymous access to most areas, but uses Windows Authentication to protect certain folders. Requests to ASP.Net pages in the protected folders behave as expected (authorized users can see them, others are denied), but any user can see any classic ASP page in the protected folders, regardless of permissions.

I suspect the windows authentication module is not being invoked for requests to classic ASP pages. We're running in integrated pipeline mode, and I found this article (http://learn.iis.net/page.aspx/244/how-to-take-advantage-of-the-iis7-integrated-pipeline/) which indicates that you need to explicitly remove and re-add modules if you want to take advantage of the integrated pipeline for non-ASP.Net requests. I tried to copy the article's example only replacing FormsAuthenticationModule with WindowsAuthenticationModule by adding the following to the web.config at the application root:

<system.webServer>
<modules>
        <remove name="WindowsAuthentication" />
        <add name="WindowsAuthentication" type="System.Web.Security.WindowsAuthenticationModule" preCondition="" />
</modules>
</system.webServer>

However, classic ASP pages are still being served regardless of permission.

like image 870
Tom Wayson Avatar asked Aug 16 '11 17:08

Tom Wayson


People also ask

Does ASP.NET support Windows authentication?

The ASP.NET Development Web Server also supports NTLM authentication. You can enable NTLM authentication by right-clicking the name of your project in the Solution Explorer window and selecting Properties.

Does Microsoft still support Classic ASP?

Classic ASP is still supported and will be all the time that it is included in IIS, which is a component of Windows Server. It has the same support lifecycle as the parent server. That's up to 2027 on Win Server 2016 and 2029 on Server 2019.

How do I force Windows authentication?

In Control Panel, click Programs and Features, and then click Turn Windows Features on or off. Expand Internet Information Services, then World Wide Web Services, then Security. Select Windows Authentication, and then click OK.

Does iis10 support Classic ASP?

Because ASP is way too old, IIS in Windows 10 does not enable ASP support by default, so we need to find it manually and turn it on.


1 Answers

Classic ASP pages totally ignore web.config or any .config actually.

The only way to handle this for classic ASP is through IIS, you will have to move the classic ASP pages to be under separate virtual website then for that virtual website set Windows Authentication and disable Anonymous Access.

This might help you as well:
IIS7: Setup Integrated Windows Authentication like in IIS6

like image 80
Shadow Wizard Hates Omicron Avatar answered Nov 15 '22 07:11

Shadow Wizard Hates Omicron