码迷,mamicode.com
首页 > 其他好文 > 详细

DefaultAuthentication Module 是怎么挂载到系统中的?

时间:2014-10-04 03:04:45      阅读:245      评论:0      收藏:0      [点我收藏+]

标签:blog   http   io   os   ar   for   文件   2014   c   

找遍Web.Config,Machine.Config,没有找到配置DefaultAuthentication Module 的地方,反射代码一看,原来是在代码中写死的:

bubuko.com,布布扣

bubuko.com,布布扣

bubuko.com,布布扣

?

这个Module还有个事件的:

bubuko.com,布布扣

可是代码中写死实例化DefaultAuthentication Module,并没有指定此事件要做什么,谁来指定此事件要做什么呢,又在哪里指定呢?

查阅资料:

http://technet.microsoft.com/zh-cn/library/system.web.security.defaultauthenticationmodule.authenticate%28v=vs.110%29

是在Global.asax中指定的:

通过在应用程序的 Global.asax 文件中指定一个名为 DefaultAuthentication_OnAuthenticate 的子例程可以访问 DefaultAuthenticationModule 类的 Authenticate 事件。

?

Global.asax中指定了,怎么对应到这个Module的这个实例上呢?

在HttpApplication的InitInternal函数里,通过调用HookupEventHandlersForAppplicationAndModules,用反射的方式挂载进去的:

bubuko.com,布布扣

?

bubuko.com,布布扣

?

分析结束。

DefaultAuthentication Module 是怎么挂载到系统中的?

标签:blog   http   io   os   ar   for   文件   2014   c   

原文地址:http://www.cnblogs.com/m15921285681/p/4005534.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!