Spring Boot Security介紹以及教程
1、Spring Boot Security介紹
Spring Boot Security是在Spring Security基礎上應用到Spring Boot上的一個框架,爲應用程序提供了一個應用安全校驗途徑,加強了應用的安全性。
所以我們對Spring Boot如何使用Spring Security。
2、Spring Boot Security默認配置的使用
使用maven來添加了一個應用包
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
啓動你的Spring Boot應用,在瀏覽器上訪問你的Spring Boot應用,我的應用地址:http://localhost:4002/,它就默認跳到它的默認登錄頁http://localhost:4002/login,
Spring Boot Security有默認的用戶:user,密碼是項目啓動時候日誌打印出密碼:Using generated security password: 4e4866db-74a7-4028-aab2-52d80128cb84後面的:4e4866db-74a7-4028-aab2-52d80128cb84,,用賬號和密碼登錄就可以了。