当前位置: 首页 > news >正文

山西爆发新病毒昆明自动seo

山西爆发新病毒,昆明自动seo,曹县汽车网站建设,沈阳网站建设费用建议先看完Spring Security总体架构介绍和Spring Security认证架构介绍,然后从FilterChainProxy的doFilterInternal函数开始,配合文章进行debug以理解Spring Security认证源码的执行流程。 在之前的Spring Security认证架构介绍中,我们已经知…

 建议先看完Spring Security总体架构介绍和Spring Security认证架构介绍,然后从FilterChainProxy的doFilterInternal函数开始,配合文章进行debug以理解Spring Security认证源码的执行流程。


在之前的Spring Security认证架构介绍中,我们已经知道,直接访问一个资源默认的大致流程是:

  1. 用户发送资源请求(资源需要认证)。后端保存请求并重定向到login登录界面。(实际流程为匿名用户在AnonymousAuthenticationFilter获得一个匿名身份,然后在AuthorizationFilter过滤器中验证权限,抛出一个AccessDeniedException异常,该异常被ExceptionTranslationFilter捕获并调用handleAccessDeniedException函数处理,该函数中判断,如果是匿名用户,就会保存请求,并重定向到登录页面。)
  2. 用户进入认证界面,并发送表单进行登录。
  3. 表单请求进入FilterChain,并在UsernamePasswordAuthenticationFilter进行验证。(实际流程为FilterChainProxy调用UsernamePasswordAuthenticationFilter继承的父类AbstractAuthenticationProcessingFilter的过滤方法doFilter,doFilter再调用重写的过滤器类的attemptAuthentication函数)
  4. UsernamePasswordAuthenticationFilter处理流程(即attemptAuthentication函数逻辑):
    1. 从表单中获得username和password,封装成UsernamePasswordAuthenticationToken。
    2. 使用AuthenticationManager(实现类为ProviderManager)验证UsernamePasswordAuthenticationToken。
    3. 验证失败:ProviderManager抛出异常,信息为“用户名或密码错误”,被UsernamePasswordAuthenticationFilter捕获(实际是父类AbstractAuthenticationProcessingFilter的过滤方法doFilter下的异常处理机制),UsernamePasswordAuthenticationFilter调用AuthenticationFailureHandler类(实现类为SimpleUrlAuthenticationFailureHandler)的onAuthenticationFailure方法,onAuthenticationFailure方法保存原请求,将错误信息保存到response中然后应用themeleaf设置到动态网页,并重定向到/login?error。
    4. 验证成功:ProviderManager调用DefaultAuthenticationEventPublisher发布一个AuthenticationSuccessEvent事件,然后清除Token中Credentials信息;之后返回到UsernamePasswordAuthenticationFilter,更新认证到用户的会话信息,然后调用successfulAuthentication,将认证存入SecurityContext,调用rememberMeServices的loginSuccess,调用ApplicationContext(AnnotationConfigServletWebServerApplicationContext)发送一个InteractiveAuthenticationSuccessEvent事件,然后调用SavedRequestAwareAuthenticationSuccessHandler的onAuthenticationSuccess函数,在这里将进行重定向到原请求路径。

进入登录示意图:

登录验证失败示意图:

登录验证成功示意图:

http://www.hkea.cn/news/341410/

相关文章:

  • 东莞企业网站建设价格怎么在百度发布免费广告
  • 网站后台地址一般是在线seo优化工具
  • 海曙区住房和建设局网站备案域名
  • 网站建设硬件环境志鸿优化设计答案
  • 网页游戏网址推荐宁波网站推广网站优化
  • 福建就福建省住房与城乡建设厅网站高端网站建设企业
  • 网站如何做seo规划app怎么开发出来的
  • 吴江住房和城乡建设局官方网站产品软文是什么
  • 公司网站制作设谷歌seo是什么职业
  • 北京品牌高端网站建设公司燕郊今日头条
  • 网站制作公司徐州宁波网站seo哪家好
  • 做网站基本费用大概需要多少全媒体运营师报考官网在哪里
  • 网站建设款属于什么科目营业推广策划
  • 建设网站查证书网络广告有哪些形式
  • 分布式网站开发网络销售平台排名
  • 网站建设模板购买品牌seo培训
  • 深圳网站建设 cms网站推广交换链接
  • 标准物质网站建设5118站长工具箱
  • 做一个能注册用户的网站网络推广费用大概价格
  • 网站建设评价东莞谷歌推广
  • php网站后台进不去百度推广入口官网
  • 个人网站一键生成免费推广网站有哪些
  • 厦门做网站设计电商seo优化
  • wordpress视频点播seo技术是干什么的
  • 网站推广是怎么做的网络营销专业如何
  • 平面设计线上兼职上海网站seo
  • 个性化网站定制价格今日热点
  • 做网站的艰辛免费个人网站申请
  • 网站改版需要多久网站设计与制作毕业论文范文
  • 深圳横岗网站建设网站建设的推广渠道