SpringBoot2.0實戰(31)整合SpringSecurity之自定義MD5加密

SpringBoot2.0實戰(31)整合SpringSecurity之自定義MD5加密

在前面的文章中,我們已經基本完成對 SpringSecurity 的整合

第二十九章:整合SpringSecurity之Swagger文檔傳遞Token

第三十章:整合SpringSecurity之基於SpEL表達式實現動態方法鑑權

目標

使用MD5加密方式進行登錄鑑權

操作步驟

自定義加密算法

自定義一個MD5加密類,需要實現 PasswordEncoder 接口,這裡的加密引用了 commons-codec 的實現,需要在 pom 文件中添加對 commons-codec 的依賴

SpringBoot2.0實戰(31)整合SpringSecurity之自定義MD5加密

註冊加密類

SpringBoot2.0實戰(31)整合SpringSecurity之自定義MD5加密

源碼地址

本章源碼 : https://gitee.com/gongm_24/spring-boot-tutorial.git


分享到:


相關文章: