my Spring application is blocking requests because of CORS.
All my controllers are annotated with @CrossOrigin
My current Spring security config is:
@Override
protected void configure(final HttpSecurity http) throws Exception {
http.httpBasic()
.and()
.authorizeRequests()
.antMatchers( "/", "/home", "/inloggen").permitAll()
.anyRequest().authenticated()
.and().csrf()
.csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse());
}
However, this configuration is blocking ALL (GET/POST) requests to all endpoints.
Using the following configuration:
@Override
protected void configure(final HttpSecurity http) throws Exception {
http.httpBasic()
.and().cors().disable()
.authorizeRequests().antMatchers("/**").permitAll()
.anyRequest().authenticated();
}
Should in theory allow all requests right?
I have tried many things. My front-end is written in Angular, simple get() requests don't work. Any help is appreciated.