【发布时间】:2010-11-10 18:15:56
【问题描述】:
有一个遗留应用程序,并从那里调用我的 MVC 应用程序。 我打算使用自定义httpmodule [AuthenticationModule 类继承IHttpModule]。在 Init 中,我连接了 BeginRequest 并执行了我的 FormAuthenication 工作......
private void Application_BeginRequest(Object source, EventArgs e) {
// Do my own authetication and issue FormAuthentication Ticket
}
在 web.config 中:
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules runAllManagedModulesForAllRequests="true">
<add name="AuthenticationModule" type="RealProperty.LegacySecurity.AuthenticationModule, RealProperty.LegacySecurity" preCondition="ManagedHandler"/>
</modules>
但我的 AuthenticationModule 在调试时从未起火... (1) 谁能解释为什么它没有被调用? (2) 在 BeginRequest 中进行身份验证是否正确?
【问题讨论】:
标签: model-view-controller httpmodule