我当前的java安全配置如下所示:
@Configuration
@EnableWebSecurity
public class RootConfig extends WebSecurityConfigurerAdapter {
@Override
protected void registerAuthentication(AuthenticationManagerBuilder auth) throws Exception
{
auth.inMemoryAuthentication()
.withUser("tester").password("passwd").roles("USER");
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeUrls()
.anyRequest().authenticated()
.and()
.httpBasic();
}
}
Run Code Online (Sandbox Code Playgroud)
当我使用浏览器执行GET请求时,我将收到错误403.我希望得到一个浏览器弹出窗口,询问我的用户名/密码.可能是什么问题?