Spring Security 验证、授权流程源码级详解
前言
spring boot 版本: 2.7.3
所有中文注释都为作者所加,源代码中并没有
本文引用spring security官网的一些图片和介绍
spring security 基本原理spring security 基于Servlet,通过Filter组成的FilterChain来过滤请求。强烈建议先看spring security官网的介绍,这对你理解spring security 有很大的帮助。这里我先介绍一些关键类或接口,强烈建议先看spring security官网的介绍。
SecurityContextHolder
Spring Security 身份验证模型的核心
它包含SecurityContext
SecurityContext
从SecurityContextHolder中获取,SecurityContext中包含Authentication
Authentication
用户未验证时,用于提供身份验证凭据(一般是username和password)
认证成功时,提供当前经过身份验证的用户
包含的属性
principal 未验证时是通常是us ...
《新概念英语二》73~96笔记
Lesson 73 The record-holdertext
Did the boy go where he wanted to?
Children who play truant from school are unimaginative. A quiet day’s fishing, or eight hours in a cinema seeing the same film over and over again, is usually as far as they get. They have all been put to shame by a boy who, while playing truant, travelled 1,600 miles. He hitchhiked to Dover and, towards evening, went into a boat to find somewhere to sleep. When he woke up next morning, he discovered that the boat had, in th ...
《新概念英语二》49~72笔记
Lesson 49 The end of a dreamtext
How did the dream end?
Tired of sleeping on the floor, a young man in Teheran saved up for years to buy a real bed. For the first time in his life, he became the proud owner of a bed which had springs and a mattress. Because the weather was very hot, he carried the bed on to the roof of his house. He slept very well for the first two nights, but on the third night, a storm blew up. A gust of wind swept the bed off the roof and sent it crashing into the court ...
《新概念英语二》25~48笔记
Lesson 25 Do the English speak English?text
Why does the writer not understand the porter?
I arrived in London at last. The railway station was big, black and dark. I did not know the way to my hotel, so I asked a porter. I not only spoke English very carefully, but very clearly as well. The porter, however, cloud not understand me. I repeated my question several times and at last the understood me. He answered me, but he spoke neither slowly nor clearly. ‘I am a foreigner,’ I said. Then he ...
《新概念英语二》1~24笔记
Lesson 1 A private conversationtext
Wyh did writer complain to the people behind him?
Last week I went to the theatre. I had a very good seat. The play was very interesting. I did not enjoy it. A young man and a young woman were sitting behind me. They were talking loudly. I got very angry. I could not hear the actors. I turned round. I looked at the man and the woman angrily. They did not pay any attention. In the end, I could not hear it. I turned round again. ‘I can’t hear a word!’I said ...
单词的不规则变化
不规则变化的动词
原型
过去式
过去分词
doing
go
went
gone
have
had
had
having
do
did
done
be
was/were
been
sit
sat
sat
sitting
get
got
got/gotten
getting
pay
paid
paid
bear
bore
borne
say
said
said
think
thought
thought
ring
rang
rung
come
came
come
coming
send
sent
sent
spoil
spoiled
spoiled
spoilt
spoilt
teach
taught
taught
lend
lent
lent
read
read
read
understand
understood
understood
make
made
made
making
buy
bought
bought
spend
spent
spent
write
wrote
writt ...
高等数学笔记(部分)
第一章:函数、极限与连续1.1 函数1.1.1 函数的性质与概念
定义:y=f(x)
一些重要性质
有界性\mid f(x) \mid \leq M
单调性x_1, x_2x_1 < x_2 , f(x_1) < f(x_2)x_1 > x_2 , f(x_1) > f(x_2)
奇偶性偶函数 f(-x) = f(x)奇函数 f(-x) = -f(x)
周期性f(x + T) = f(x)
1.1.2 初等函数
基本初等函数
复合函数
初等函数
1.2 极限的概念1.2.1 数列的极限\lim_{n \to +\infty}x_n = A1.2.2 函数的极限
\lim_{n \to +\infty}f(x) = A
\lim_{x \to x_0}f(x) = A \iff \lim_{x \to x_0^+}f(x) = \lim_{x \to x_0^-}f(x) = A
函数在某一点的极限
1.2.3 无穷小量与无穷大量
无穷小量
性质
有限个无穷小量的代数和是无穷小量
有限个无穷小量的乘积是无穷小量
无穷小量与有界变量的乘积是无穷小量
常数与无穷小量的乘积是无穷小 ...
KMP算法
代码部分12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576#include "string.h"#include "stdio.h"/** * 获得目标串在某个位置匹配错误时,目标串应该跳转索引值,在pat[i]匹配错误时,i = lps[i-1] * @param pat 模式串 * @param M 模式串的长度 * @param lps(longest proper prefix which is also suffix) 对应索引值数组 */void GetLPSArray(const char *pat, int M, int *lps) { // length of the previous longest prefix suffix(pat每个字符对应len都是包括当前字符在内的前le ...
读《厌女:日本的女性嫌恶》
机缘巧合下读到了日本学者上野千鹤子写的《厌女:日本的女性女性嫌恶》(以下简称《厌女》),虽然该书的案例全部发生在日本,但应该在中国也有相似点。《厌女》中讨论的点太过繁杂,我仅在警醒自己不陷入厌女的角度下进行讨论。
什么是厌女症我在书中并没有看到作者关于厌女症的定义,只是有提到它的表现。在男人身上表现为“女性蔑视”,在女人身上则表现为“自我厌恶”。书中有一个浅显的说法,有一次也没有庆幸过没生为女人的男人吗?有一次也没有抱怨过身为女人吃了亏的女人吗?《厌女》中是每一章节讲述不同的群体的厌女症表现,所以本文也按《厌女》的章节来讨论。
第一章-喜欢女人的男人的厌女症我想这章的核心是,男人在构造一个理想中的女人,但现实中的女人并不是这样。在整个社会的暴力下,会要求女人应该做到男人理想中的女人。
例如在中国有一句老话“男主外,女主内”,这强调的是只有男人能当大任,女人只能在家相夫教子。最离谱的是这一句话,我在一个女人口中听到过。再有一个例子是最近在学校老师口中听到的,分别是一个男老师,一个女老师。这两位老师都说了一个大概相同的话“女孩子相比男孩子逻辑思维能力要差一点,所以你们可以不用研究 ...
写于二十一岁
学于二十一岁2021年8月1日,二十一岁这个时间点对我来说是具有一点特殊的意义。结束了三年的大专生活,在暑假里已经体验了两个月的打工生活。但最重要的是期待一个月后的本科生活。回想我这二十一年,最有意义、有趣的莫过于大专这三年。但在中学阶段也有两件影响我整个人生的大事。第一件是在中考后,分数刚好能上普高的我最终没有受初中老师的哄骗去读职高而成为一个修车的。第二件就是在高中没有一直堕落下去。高一的我根本不听任何课,上课只是在发呆或者玩手机。在高一下学期下午的某一节课,班主任在教育我们说要努力,努力是有希望的。听到这番话的我突然醒悟到不能一直这样下去,尝试开始听课、学习。虽然在现在看来我根本就没做任何努力,连一个高中生应该做的事都没有做好,每两周放假的两天时间里依旧是在打游戏,英语单词也没有记,化学也没有努力学习下去。但对比以往却是有了很大的进步。要是没有这点进步,我连这所改变我命运的大专都进不了。在大专也是有两件事影响了我的整个人生。第一件是在大一下学期听辅导员说学校机房管理员缺岗位,一天有三十元。我当时想着干一天就能买一本书,脑袋一发热就去申请这个岗位了。当时的我根本不可能想到我能在这 ...