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

成都装修建材网站建设企业服饰网站模板

成都装修建材网站建设,企业服饰网站模板,国际服务器,公司制作一个网站要多少钱总的流程分为两部分#xff0c;一是先用Map把configurer收集起来#xff0c;然后再把maper中所有的configurer应用到HttpSecurity对象。 其中的map位于AbstractConfiguredSecurityBuilder这个类。 private final LinkedHashMapClass? extends SecurityConfigurer一是先用Map把configurer收集起来然后再把maper中所有的configurer应用到HttpSecurity对象。 其中的map位于AbstractConfiguredSecurityBuilder这个类。 private final LinkedHashMapClass? extends SecurityConfigurerO, B, ListSecurityConfigurerO, B configurers;configurer添加分为两部分都通过WebSecurityConfigurerAdapter的init方法来实现 public void init(WebSecurity web) throws Exception {HttpSecurity http this.getHttp();web.addSecurityFilterChainBuilder(http).postBuildAction(() - {FilterSecurityInterceptor securityInterceptor (FilterSecurityInterceptor)http.getSharedObject(FilterSecurityInterceptor.class);web.securityInterceptor(securityInterceptor);});}其中init方法会调用的 protected final HttpSecurity getHttp() throws Exception方法 protected final HttpSecurity getHttp() throws Exception {if (this.http ! null) {return this.http;} else {AuthenticationEventPublisher eventPublisher this.getAuthenticationEventPublisher();this.localConfigureAuthenticationBldr.authenticationEventPublisher(eventPublisher);AuthenticationManager authenticationManager this.authenticationManager();this.authenticationBuilder.parentAuthenticationManager(authenticationManager);MapClass?, Object sharedObjects this.createSharedObjects();this.http new HttpSecurity(this.objectPostProcessor, this.authenticationBuilder, sharedObjects);if (!this.disableDefaults) {//添加第一部分configurerthis.applyDefaultConfiguration(this.http);ClassLoader classLoader this.context.getClassLoader();ListAbstractHttpConfigurer defaultHttpConfigurers SpringFactoriesLoader.loadFactories(AbstractHttpConfigurer.class, classLoader);Iterator var6 defaultHttpConfigurers.iterator();while(var6.hasNext()) {AbstractHttpConfigurer configurer (AbstractHttpConfigurer)var6.next();this.http.apply(configurer);}}//这句代码调用本类中的configure方法继续添加configurerthis.configure(this.http);return this.http;}}该方法中执行了this.applyDefaultConfiguration(this.http)其代码为 private void applyDefaultConfiguration(HttpSecurity http) throws Exception {http.csrf();http.addFilter(new WebAsyncManagerIntegrationFilter());http.exceptionHandling();http.headers();http.sessionManagement();http.securityContext();http.requestCache();http.anonymous();http.servletApi();http.apply(new DefaultLoginPageConfigurer());http.logout();}另一部分是通过WebSecurityConfigurerAdapter的config方法添加的configurer protected void configure(HttpSecurity http) throws Exception {this.logger.debug(Using default configure(HttpSecurity). If subclassed this will potentially override subclass configure(HttpSecurity).);http.authorizeRequests((requests) - {((AuthorizedUrl)requests.anyRequest()).authenticated();});http.formLogin();http.httpBasic();}至此configurers填充完毕。 AbstractConfigedSecurityBuilder的private void configure() throws Exception 这个方法会遍历之前填充好的configurer,将其应用到HttpSecurity对象也就是添加了Fliter private void configure() throws Exception {CollectionSecurityConfigurerO, B configurers this.getConfigurers();Iterator var2 configurers.iterator();while(var2.hasNext()) {SecurityConfigurerO, B configurer (SecurityConfigurer)var2.next();configurer.configure(this);}}该方法的循环体执行完成后HttpSecurity对象就包含了15个过滤器。 以上是使用Spring Security5进行的分析。 Spring Security 6使用AuthorizationFilter取代了FilterSecurityInterceptor
http://www.hkea.cn/news/14464603/

相关文章:

  • 网站个人和公司有什么区别是什么上海建设工程交易服务中心
  • 新建网站怎么想谷歌和百度提交西宁做网站的公司旭云网络
  • 服装公司网站源码私募基金网站怎么做seo
  • wordpress 做大型网站搜索引擎营销ppt
  • wordpress新建页面有什么作用百度快速优化软件
  • 营销网站建设案例正定网站建设
  • 网站备案转服务器wordpress iis 分页 404
  • WordPress网站接入公众号飞扬世纪网站建设
  • 寿光专业做网站广东新闻联播
  • wordpress做网站手机修水县城乡建设局官方网站
  • 如何做盗版视频网站揭阳建网站
  • 主流网站开发医疗营销的网站怎么做
  • 深圳做网站公司有哪些大型网站开发周期
  • 做微商有什么好的货源网站柳市建设网站
  • 网站开发人员的行业分析有哪个网站可以做兼职
  • 建筑钢结构网站湖北高端网站建设
  • 宁波网站设计建站服务公司搭建一个微信小程序要多少钱
  • 免费注册自助网站广告图片网站源码
  • 一个空间如何做2个网站做网站平台
  • 百度商桥怎么绑定网站产品营销型网站建设
  • 大麦网网站建设的功能定位谁会在阿里云建网站
  • 上海建设企业网站游戏推广赚佣金的平台
  • 官方网站建设哪家公司好用什么做响应式网站
  • 手机网站模板 php长沙网站开发方案
  • 湖南省城乡住房建设厅网站seo优化
  • openshift 做网站微网站建设哪家好
  • 怎样无货源开网店陕西网络营销优化公司
  • 网站的访问量统计怎么做做博客和做网站
  • 制作网站要找什么公司厦门网站制作建设
  • 济南网站建设选聚搜网络认可冠县建设局网站