In this lecture , we will see how to enable and disable the cross-orgin resource sharing (CORS) in Rest API with Spring Security in Spring Boot
How to enable Cross-orgin resource sharing
How to disable Cross-orgin resource sharing in spring security?
What is Cross-orgin resource sharing
How to deal Cross-orgin resource sharing ( CORS)
let understand this with a small example, so that it will be easy for you to understand the concept.
Let say, i have an application with name myaaplication which is hosted on port 8080 alright.
And it can be access by different client with different URL so in myApplication i can add restrcition like who can access my application recourses or who cannot.
And also i can add restriction on url. It means i can add restrcition to particular url or endpoint.
So for url rescrtiction , you need to specify in the myapplication which url you want to restrict
.
so let suppose i added http:// localhost:9091 then it is going to only allow with url containing port 9091. other then it will deny that request.
So that is all about cross orgin recource sharing.
What is CORS
What is No 'Access-Control-Allow-Origin' header is present on the requested resource,
How to add spring security using spring boot
What is CORS policy
Spring security + Spring Boot
Share | Comment | Like
Watch video How to Enable and Disable Cross-Orgin Resource Sharing(CORS) in Rest API | Spring Security in Detail online without registration, duration hours minute second in high quality. This video was added by user XAdmin 01 January 1970, don't forget to share it with your friends and acquaintances, it has been viewed on our site 86 once and liked it 0 people.