English 中文(简体)
How can I protect ASP.NET sites behind a Windows password and forms authentication?
原标题:

I m developing an ASP.NET MVC site that utilizes forms authentication for part of the application. During development, I need to be able to give external parties access to a development server hosting the site. Since I don t want to expose the site to the entire internet, I need to password protect it while still allowing forms authentication to be in use.

Mixing of Windows and forms authentication doesn t work. Is there a standard way of doing this? I would have to think this is a common scenario. The article on MSDN doesn t seem to apply to my situation: http://msdn.microsoft.com/en-us/library/ms972958.aspx

Update: The first two answers suggest adding in standard IIS basic/digest authentication. As far as I know, this is not compatible with forms authentication because the user s identity will be set to the Windows account, not the identity used through forms authentication. I need the two to be completely independent. Any thoughts?

问题回答

You could protect it in IIS, give those details to the external parties, and leave the forms auth as it is.

Disable anonomous access to force the users to login via a windows account before accessing the site.

I knew a guy who did this using Apache and a reverse proxy.

http://www.apachetutor.org/admin/reverseproxies

Well unfortunately what you re trying to do is not possible in IIS7 (integrated mode), but there is a workaround. I suggest you to read this article written by Mike Volodarsky a former program manager for IIS7 at Microsoft. Article addresses your problem and there is even a sample code you could use.





相关问题
Session Management with Windows Authentication

In an ASP.NET web app, using Integrated Windows Authentication, is the session tied to the windows identity? In other words, if I login (using IWA) to the app, and the app stores some "stuff" in my ...

Using Elmah with Cassini

Does anyone know if I can use Elmah with Visual Studio build-in web server(aka Cassini)? I get it working easily on IIS, but using same configuration, it doesn t work with Cassini. When I requested ...

Setting hostname in IIS, include www?

I want to set the hostname for a website I m adding in IIS 7, however do I include the www in the hostname or not? because I want both www.mysite.com and mysite.com both to point to mysite on the ...

inetpub versus any other folder

I ve run websites out of inetpub, as well as from folders just residing on the C: drive. I wonder, are there any definitive advantages to running websites out of inetputwwwroot?

IIS 6.0 hangs when serving a web-service

I am having issues with one of our web-services. It works fine on my development machine (win XP) whether I host it as a separate application or using cassini from Visual studio. Once I deploy on the ...

热门标签