CORS Filter to Spring Security

CORS Filter to Spring Security


When you enable spring security to your spring boot application, add cors filter otherwise everything would be blocked
@Override
protected void configure(HttpSecurity http) throws Exception {
    http.cors()
            .and().authorizeRequests()
            .anyRequest().permitAll()
            .and().csrf().disable();
}

No comments:

 My Attempt to learn AI  GPT Generative Pretrained Transformer Created by Google in 2017 with the publication of the paper "Attention ...

Popular in last 30 days