首页 > 其他 > 详细

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

时间:2014-10-04 01:56:25      阅读:271      评论:0      收藏:0      [点我收藏+]

找遍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 是怎么挂载到系统中的?

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!