我想使用Spring Security进行JWT身份验证.但它带有默认身份验证.我试图禁用它,但是这样做的旧方法 - 禁用它application.properties- 在2.0中已弃用.
这是我试过的:
@Configuration
public class StackWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.httpBasic().disable();
// http.authorizeRequests().anyRequest().permitAll(); // Also doesn't work.
}
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能简单地禁用基本安全性?
更新
可能很高兴知道我不使用web mvc而是web flux.
spring-security spring-boot spring-security-rest spring-webflux