javascript
Springsecurity之AuthenticationProvider
2019獨角獸企業重金招聘Python工程師標準>>>
? ? 注意:AuthenticationProvider與Authentication緊密聯系,關于Authentication,看我的這篇博客。
????先上一張圖,如下圖1
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 圖1 AuthenticationProvider的類圖
? ? AuthenticationProvider是個接口,通過實現這個接口,實現拓展,此圖來自于《Pro Spring Security》的Chapter3:
? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 圖2 AuthenticationProvider的繼承圖
? ? 來看個例子,DaoAuthenticationProvider,它的類圖如下圖3,使用了Template pattern,在AbstractUserDetilsAuthenticationProvider中定義執行邏輯,而在DaoAuthenticationProvider中有具體實現。Template pattern可以在一定程度上理解為父類調用子類。
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 圖3 DaoAuthenticationProvider的類圖
?
參考:
? ? 1. Carlo Scarioni, Pro Spring Security.
轉載于:https://my.oschina.net/u/2518341/blog/1976100
總結
以上是生活随笔為你收集整理的Springsecurity之AuthenticationProvider的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python 数组 运算_python数
- 下一篇: Spring集成redis(Spring