Java Spring Boot - REST Web Service - Security - CORS Policy Configuration - Allow All - Fix
Автор: CodeForgeYT
Загружено: 2020-11-18
Просмотров: 25426
In this video we will learn how to solve problem with cors policy no 'access-control-allow-origin' header is present on the requested resource error. We will explore different ways of configuring CORS in our Java Spring Boot application. This fix will solve problem for each client technology like Angular, React.js or Vue.js.
We will start with @CrossOrigin annotation on the method level and after making some test we will go back to the code to use same annotation, but on the controller level. We will learn how to define multiple origins and how to allow only selected HTTP methods.
At the end we will learn how to create configuration class that will return bean with the CORS conifguration, so it will be applied for each endpoint exposed by our web service. For our configuration class we will also check out how to inject property from application.properties file using @Value annotation so later it can be used in CORS conifguration.
We will test each method with sample Angular web application. Keep coding!
Code for this video: https://github.com/codeforgeyt/one-to...
If you don't want to deep dive into CORS configuration you can check a short version of the video: • Java Spring Boot - Web Service 5: Security...
Follow //CodefForgeYT on:
FB: / codeforgeyt
Twitter: / codeforgeyt
GitHub: https://github.com/codeforgeyt
Instagram: / codeforgeyt
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: