Spring Boot Security介紹以及教程

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,,用賬號和密碼登錄就可以了。

 

 

發佈了133 篇原創文章 · 獲贊 45 · 訪問量 14萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章