Good morning.
I have been fighting with this issue for the past two days so I decided to post a question about it.
Basically I have a Spring Boot project which executes basic CRUD operations through a React JS front-end. Everything seemed to work fine until I added Spring Security to the project. Since then whenever I make a request (using axios) from the front-end I get the following error:
Access to XMLHttpRequest at 'http://localhost:8080/calciatore/list' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Before implementing Spring Security everything worked perfectly just using @CrossOrigin(origins = "*")
in my back-end controllers, but now I always get that error even if the URL is configured not to be protected through login by Spring Security.
In the meanwhile, I have no problems making any request (POST for login or GET for data fetching) from Postman.
I tried looking for a solution all around the internet but still didn't find one.
If you need me to show a portion of code just ask.
Thanks in advance.