创建项目选择了springboot security
pom.xml配置如下
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
直接运行项目
后台输出如下条目:
Using generated security password: 16122ac22-7896-41c2-a756-c0e533ef04aa
前台如下,用户名为user 密码为上述密码

登录后界面如下

本文介绍了如何在SpringBoot项目中集成SpringSecurity,通过配置pom.xml文件引入spring-boot-starter-security依赖,实现基本的安全控制。文章展示了配置示例,并演示了如何使用默认的用户名和密码进行登录。
1159

被折叠的 条评论
为什么被折叠?



