【发布时间】:2020-06-19 09:55:33
【问题描述】:
所以我的问题与 Spring Boot 的其他问题有点不同。我想在我的安全配置中允许发布请求,但仅限于身份验证
这是我的配置文件:
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.anyRequest().authenticated()
.and()
.httpBasic();
http.csrf().disable();
}
感谢您的帮助;)
【问题讨论】:
-
那么 GET 和所有其他请求呢?
-
获取请求有效。但我猜 crsf 或其他东西阻止了帖子
-
是的,但我不确定这是否是典型的做法
标签: spring-boot spring-security