SSL后禁止Spring Security 403
我在Spring Boot后端添加了一个自我认证的SSL证书,但在这之后,我的请求中出现了一个SSL后禁止Spring Security 403,spring,spring-boot,spring-security,spring-security-rest,Spring,Spring Boot,Spring Security,Spring Security Rest,我在Spring Boot后端添加了一个自我认证的SSL证书,但在这之后,我的请求中出现了一个403禁止的错误 安全配置: @EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter { @Autowired DataSource dataSource; @Autowired public void configureGlobal(Authenti
403禁止的错误
安全配置:
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
DataSource dataSource;
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.jdbcAuthentication().dataSource(dataSource)
.usersByUsernameQuery("select username,password,enabled from users where username=?")
.authoritiesByUsernameQuery("select username, role from authorities where username=?");
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable();
http.authorizeRequests()
.anyRequest().authenticated();
http.requiresChannel().anyRequest().requiresSecure();
}
}