spring-boot - Spring Boot 2 http.httpBasic().disable(); 不工作
问题描述
我最近从 Spring Boot 1.x 升级到 Spring Boot 2.0.3,我试图禁用基本身份验证但没有成功。
@Configuration
@EnableWebSecurity(debug=true)
@EnableGlobalMethodSecurity(securedEnabled = true)
public class CustomSecurity extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
super.configure(http);
http.httpBasic().disable();
// the rest of my config
}
}
我缺少什么隐藏的宝石来简单地关闭基本身份验证?为什么现在在 Spring 中关闭事物需要如此困难?
我正在阅读此内容: https ://github.com/spring-projects/spring-boot/issues/10306 ,我必须同意它应该更容易,并且应该就如何关闭它提供更清晰的解释。
编辑此链接https://spring.io/blog/2017/09/15/security-changes-in-spring-boot-2-0-m4 讨论了如何删除该属性,但没有说明如何继续使用配置,因为它存在于使用它的当前应用程序中。
解决方案
推荐阅读
- python - 没有名为“termcolor”的模块
- javascript - Ext JS 6 无法右对齐我的按钮 xtype
- javascript - 如何从对象中对数组进行排序?
- java - 使用流检查列表是否只有Java中的特定元素排列
- c - MIPS 操作存储在数据中的数组
- angular - Angular 2 - HTML & CSS to PDF(作为电子邮件附件发送)
- sql - Hive SQL 查询 json 结果并将键显示为列
- scala - 了解 scala 中 tailrec 注释递归方法的性能
- javascript - 选项更改时如何清除与选择一起使用的 v-model
- java - 获取包含数字签名的pdf页面的页面索引