Inlägg

Visar inlägg med etiketten Servlet API

Spring Boot 3 with CORS and CSP

 Spring Boot 3 with CORS and CSP Honestly I thought it was very difficult implementing CORS and CSP. But I had done it before with Servlet API and realized you could do the same by using a jakarta.servlet.Filter. You can find the code here  https://github.com/AIMMOTH/spring-boot-3/tree/auth0-cors-csp-security Request  After reading Baeldung's blog it was easy to implement the 2 different filters. For the request I use a component with a high order and checks the request origins: