Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SSL后禁止Spring Security 403_Spring_Spring Boot_Spring Security_Spring Security Rest - Fatal编程技术网

SSL后禁止Spring Security 403

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

我在Spring Boot后端添加了一个自我认证的SSL证书,但在这之后,我的请求中出现了一个
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();               
    }
}