【发布时间】:2021-12-04 22:01:44
【问题描述】:
我已将 securityConfig 定义如下:
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.jdbcAuthentication()
.dataSource(dataSource)
.passwordEncoder(passwordEncoder())
.usersByUsernameQuery(\\some code\\)
.authoritiesByUsernameQuery(\\some code\\)
.getUserDetailsService();
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.anyRequest().authenticated()
.and()
.httpBasic().authenticationEntryPoint(entryPoint);
}
当我在浏览器的表单中输入凭据时,它工作正常,
我收到 403 错误。我做错了什么?
【问题讨论】:
标签: spring-boot tomcat basic-authentication