摘要: 学习ABP源码过程中,我将ABP源码用UML类图画了下来,看起来要比直接看源码轻松许多。 阅读全文
posted @ 2016-09-09 13:56 jeremyyang824 阅读(1331) 评论(4) 推荐(5) 编辑

 

    IAuthenticationFilter是MVC5中的新特性,它有2个关键方法:

  • OnAuthentication
  • OnAuthenticationChallenge

    当IAuthenticationFilterIAuthorizationFilter结合使用时,流程看似比较复杂:

  1. 根据路由选择Controller和Action
  2. 如果设置了IAuthenticationFilter,则会调用OnAuthentication方法
    • 在OnAuthentication中如果设置了context的Result,则会直接跳转到OnAuthenticationChallenge方法。
    • 如果OnAuthentication中没有设置context的Result,则交由IAuthorizationFilter处理(如果没有定义IAuthorizationFilter,则进入Action方法)。
  3. 如果设置了IAuthorizationFilter,则执行授权逻辑调用OnAuthorization方法
    • 在OnAuthorization中如果设置了context的Result,则会直接跳转到IAuthenticationFilter的OnAuthenticationChallenge方法。
    • 如果OnAuthorization中没有设置对应context的Result,则进入Action方法。
  4. IAuthenticationFilter的OnAuthenticationChallenge方法始终会在ActionResult的ExecuteResult执行之前运行。

 

posted @ 2016-07-08 17:33 jeremyyang824 阅读(3618) 评论(1) 推荐(5) 编辑
摘要: 之前在学习Artech的《ASP.NET MVC4框架揭秘》一书,学习过程中画了ASP.NET MVC4框架的草图,方便记忆。 阅读全文
posted @ 2016-01-04 17:06 jeremyyang824 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 仿windows造字程序的思路,采用方格画布拖拽区域定位的图片组合生成控件。 阅读全文
posted @ 2008-12-19 12:55 jeremyyang824 阅读(2392) 评论(2) 推荐(0) 编辑
摘要: 以组合模式建立横向树形Html表格 阅读全文
posted @ 2008-05-24 02:30 jeremyyang824 阅读(7404) 评论(22) 推荐(0) 编辑
点击右上角即可分享
微信分享提示