Hello friends, Browser security prevents a web page from making requests to a different domain than the one that served the web page. This restriction is called the same-origin policy. The same-origin policy prevents a malicious site from reading sensitive data from another site.
Sometimes, you might want to allow other sites to make cross-origin requests to your application. This is usually when you have an API hosted independently and your different web applications talking to the API. In such scenarios, we need to enable CORS support on the API, so that the web application can call it.
In this video, let's learn about CORS, how it works, how to enable it in ASP NET API. I will show to how to simulate a CORS error in ASP NET Single Page Application and then add the appropriate configuration to ease the browser policies using CORS.
CORS is not a security feature, It is a W3C standard to relax same-origin policy. However if configured incorrectly CORS can cause potential issues to your application. Make sure to be explicit about the origins that can interact with the API that you are building.
🔗Source Code - Source Code: rahulpnath.vis...
🔗Enable CORS in ASP NET Core - docs.microsoft...
🔗Migrate from ASP.NET Core 2.2 to 3.0 - docs.microsoft...
Additional Watching
📹SINGLE PAGE APPLICATION (SPA) TEMPLATES in ASP.NET Core - • SINGLE PAGE APPLICATIO...
📹DEPENDENCY INJECTION in ASP.NET Core - • DEPENDENCY INJECTION i...
📹MIDDLEWARE in ASP.NET Core - • MIDDLEWARE in ASP.NET ...
📹ASP NET Core Series - • ASP.NET Core
Come say hi! ✋
🌍 Blog - rahulpnath.com/
✉ Subscribe to my Newsletter - www.rahulpnath...
🐦Twitter - / rahulpnath
📸Instagram - / rahulpnath
🎥 Recording Setup and Workflow - www.rahulpnath...
Video Edited by my wife, Parvathy 😍
Make sure to SUBSCRIBE to the channel. THANK YOU for helping me grow this channel !!
5 сен 2024