maven
1
2
3
4
| <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
|
config
1
2
3
4
5
6
7
8
9
10
| @Configuration
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.anyRequest().authenticated()
.and().formLogin().loginProcessingUrl("/login").permitAll()
.and().csrf().disable();
}
}
|
1
2
| spring.security.user.name=admin
spring.security.user.password={bcrypt}$2a$10$io1baOv5SiP2G0DR.Dye.OQjtj1W8Aba31pGecyYdxgoXLkLjdfm.
|
文章作者
lim
上次更新
2024-11-21
(1dac9ff)
许可协议
CC BY-NC-ND 4.0