
This works as follows (as shown in the diagram above):ġ) Anonymous request to page.aspx (a protected page in your app)Ī.
#Iis website authentication windows
This way, our Windows authentication challenge will work correctly. Secondly, using a wrapper module, we will disable Forms authentication for the gateway (login) page. Luckily, this maps well into the Forms Authentication model of having a separate login page which will become our gateway. The answer lies in separating the windows authentication and forms authentication transactions into two separate pages – one page will be the gateway page that requires Windows authentication, and the other page (or pages) will require forms authentication.
#Iis website authentication how to
Additionally, because Forms authentication is enabled for the entire application, there is no way to enable it for a part of your app and not for another – which presents a problem, because Forms authentication’s 302 redirect challenge is incompatible with the 401 “Here is how to do it …Īfter posting the list of ASP.NET breaking changes for IIS 7.0, a number of people contacted me asking for a way to accomplish this. But, in Integrated mode, both Windows and Forms authentication run during the single stage authentication process, which makes it impossible to first authenticate with Windows authentication, and second authenticate with Forms authentication. This works on IIS 6.0 and on IIS 7.0 in Classic mode. You could do that by enabling Windows authentication and disabling Anonymous authentication in IIS, which would cause the request to be rejected by IIS before it would arrive in ASP.NET, thereby making sure that your users were first authenticated by Windows auth. For some reason, you want all users to first log in using their Windows credentials, and then log in using their Membership credentials and Forms authentication. But, all of your users also have Windows accounts on the server (or Active Directory). You have a login.aspx page which allows your users to log in using Forms authentication. Because of this, certain authentication schemes that relied on the two-stageness of the authentication process used by ASP.NET applications in the past no longer work.

Unfortunately, one of the limitations of a single-stage authentication model is that it is done in a single stage (imagine that!). The problem: using ASP.NET Forms authentication and IIS Windows authentication in the same application

If you regularly troubleshoot IIS errors, manage Windows Servers, or tune ASP.NET performance, definitely check out the demo at Popular example – everyone’s favorite Forms authentication, backed by a Membership credential store and login controls, being used to secure access to your entire Web site including your images, PHP pages, CGI applications, and so on. Update: We recently launched a service that significantly helps you understand, troubleshoot, and improve IIS and ASP.NET web applications.
