Is there a port of the Mixed Authentication Disposition ASP.NET Module (MADAM) for ASP.NET MVC?
The Mixed Authentication Disposition ASP.NET Module (MADAM) is exactly what I need for the project I'm building in MVC2. I'm not an expert on authentication, could MADAM be quickly retrofitted to work with the MVC pipe开发者_JAVA技巧line?
http://msdn.microsoft.com/en-us/library/aa479391.aspx
Depending on your Server Version of IIS, you will need to place the MADAM modules into different locations within your web.config file.
IIS 6
<system.web>
<httpHandelers>
<-- Madam Modules go here -->
</httpHandelers>
</system.web>
IIS 7
<system.webServer>
<httpHandelers>
<-- Madam Modules go here -->
</httpHandelers>
</system.webServer>
I have been looking into using MADAM for my current project at work as well, however I cannot seem to get it to fire.
It would appear that something has changed in the way that either ASP.Net processes requests and deals with HttpModules or it is a difference in the ASP.Net MVC pipeline.
The quickest solution that I have been able to find is to split the project into two separate projects and host them as different applications in IIS otherwise the authentication will not work as desire.
As far as I can tell if you leave Forms Authentication on, MADAM does not fire and any paths which you wanted Http-Basic authentication for just redirect to the login/or default page. If you have Forms Authentication off then the Http-Basic authentication will work, but the Forms Authentication will not work as it cannot read the .ASPXAUTH cookie automatically.
Unless I stumble across some way to get it working I will have to split this project into two and host each as a separate application in IIS.
If you have any other work arounds they would be gratefully received.
I haven't used MADAM, but based on the diagram I don't see any reason why you couldn't implement this process in an AuthorizationFilter
or wire it up directly to HttpApplication.AuthorizeRequest
event. ASP.NET MVC is still subject to the ASP.NET HttpApplication
life cycle.
精彩评论