2022年1月5日
摘要: 在上上篇spring security 源码学习(三)WebSecurityConfiguration中对AuthenticationManager做过简单的介绍,这里,我们详细分析下AuthenticationManager。 先简单描述下标题的这3个类有啥关系,AuthenticationMan 阅读全文
posted @ 2022-01-05 21:21 幽人月 阅读(840) 评论(0) 推荐(0) 编辑
  2021年12月22日
摘要: SecurityFilterChain是Spring security真正执行认证授权的类。这个类初始化是从HttpSecurity的build而来。也就是上篇文章securityFilterChainBuilder.build()处得来。为了省去翻到上一篇文章,我把必要的代码和类图传送过来。 fo 阅读全文
posted @ 2021-12-22 23:42 幽人月 阅读(659) 评论(1) 推荐(0) 编辑
  2021年12月13日
摘要: 本篇目标是解析WebSecurityConfiguration是如何初始化的 首先,看下他的源码。 /** * Uses a {@link WebSecurity} to create the {@link FilterChainProxy} that performs the web * base 阅读全文
posted @ 2021-12-13 22:52 幽人月 阅读(907) 评论(0) 推荐(1) 编辑
摘要: spring security的开始就是从@EnableWebSecurity注解开始的,让我们看下这个注解。 @Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) @Target(value = { java.lang.a 阅读全文
posted @ 2021-12-13 22:03 幽人月 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 这边的demo是直接拿的官网的demo 官网地址:https://spring.io/guides/gs/securing-web/ 阅读全文
posted @ 2021-12-13 21:55 幽人月 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 本页面为目录页面,提供后续文章的跳转,持续更新 spring security项目搭建 spring security核心类解析 (一)WebSecurityConfiguration (二)SecurityFilterChain spring security OAuth2 阅读全文
posted @ 2021-12-13 21:38 幽人月 阅读(59) 评论(0) 推荐(0) 编辑
  2020年9月22日
摘要: (一)背景 现在的项目大多用的是spring框架,然后就方便的直接用RestTemplate,但是在实际使用时常常会发现出现乱码的情况,今天总结下这些情况 (二)request乱码 request乱码就是,请求别人的接口,比如别人需要你的编码格式是“UTF-8”,而我的是“ISO-8859-1”,那 阅读全文
posted @ 2020-09-22 16:43 幽人月 阅读(1761) 评论(0) 推荐(0) 编辑
  2020年9月17日
摘要: 前言 RestTemplate进行http相关的请求的最底层的实现是利用的java原生的api java.net.URLConnection等实现的,关于如何实现的可以看上一篇文章中的demo。了解了java原生的http请求对解析RestTemplate源码很有帮助。 核心doExecute方法 阅读全文
posted @ 2020-09-17 22:28 幽人月 阅读(704) 评论(0) 推荐(0) 编辑
摘要: java原生http请求的实现是依赖 java.net.URLConnection post请求的demo public class Main { public static void main(String[] args) { postDemo(); } /** * POST请求 */ publi 阅读全文
posted @ 2020-09-17 22:24 幽人月 阅读(2125) 评论(0) 推荐(0) 编辑
  2020年7月13日
摘要: (一)java异常 Throwable这个Java类被用来表示任何可以作为异常被抛出来的类。Throwable对象可分为两种类型(指从Throwable继承而得到的类型):Error用来表示编译时和系统错误(除特殊情况外,一般不用关心);Exception是可以被抛出的基本类型。所以Java程序员关 阅读全文
posted @ 2020-07-13 23:22 幽人月 阅读(545) 评论(0) 推荐(0) 编辑