tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

Spring Security Angular "request from origin ... blocked by CORS policy"

Open dbnex14 opened this issue 4 years ago • 0 comments

I am looking at the Spring Security Angular module provided and from everything I read and tried, it does not make sense as it does not mentions CORS at all.

  1. The HttpSecurity configuration is missing it,
  2. There is no CorsConfigurationSource anywhere
  3. And the default Spring provided /login is overriden by a login controller which usually is not needed

Would you be able to provide more details on CORS as all I get is error like:

Access to XMLHttpRequest at 'http://localhost:8080/myapi/v1/auth' from origin 'http://localhost:4200'/ has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

, when trying to login.

dbnex14 avatar Apr 08 '22 15:04 dbnex14