Try allowing all paths when you set allowed origins. So change this configuration.setAllowedOrigins(List.of("http://localhost:4200"));
configuration.setAllowedOrigins(List.of("http://localhost:4200"));
to something like this: configuration.setAllowedOrigins(List.of("http://localhost:4200/**"));
configuration.setAllowedOrigins(List.of("http://localhost:4200/**"));