Spring Security

Spring Security

Maven依赖

1
2
3
4
5
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
<!-- 6.19版本往后需要java17 -->
</dependency>

加入到项目以后,会有一个/login页面,需要登录才能访问其他页面,默认用户名user,密码在启动日志中

也可以配置用户名和密码

1
2
3
4
5
spring:
security:
user:
name: jiahe
password: jiahe45

Spring Security
http://example.com/2024/10/25/Spring-Security/
Author
J1aHe
Posted on
October 25, 2024
Licensed under