SpringSecurity简介
![](https://i-blog.csdnimg.cn/blog_migrate/94517d1bfaf0daf5667c8d1fb6af7476.png)
1.导入依赖
<!--springsecurity-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
2.编写配置类
![](https://i-blog.csdnimg.cn/blog_migrate/5eb4aa737cc121e193a1be4b6113e3d6.png)
package com.fdw.springbootstudy.config;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecu