现在我配置网络安全适配器,如 -
@EnableWebSecurity
@Configuration
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.cors().and()
.authorizeRequests()
.anyRequest()
.fullyAuthenticated().and()
.httpBasic().and()
.csrf()
.disable();
}
}
如果未通过身份验证,哪个工作正常并阻止所有请求。但现在我想阻止除/login
. 我的意思是,我希望只是不安全,/login
并且/login/*
应用程序的其余部分是安全的。
任何人都知道我怎样才能做到这一点?