Understanding CORS with ASP.NET Core C#

  Рет қаралды 13,312

Raw Coding

Raw Coding

Күн бұрын

Пікірлер: 28
@rustamhajiyev
@rustamhajiyev Жыл бұрын
Epic explanation! Gets directly into the golden collection 😍Thank you!
@newmonengineering
@newmonengineering Жыл бұрын
Well explained. I understand it a bit better now. I already knew how to fix the errors but this added a bit more depth to my understanding. I never saw it done the manual way before, it makes more sense. Thanks.
@AbuBakrSadiqi-b7t
@AbuBakrSadiqi-b7t Жыл бұрын
Well explained, one of the best video I have watched for CORS. Thanks for that.
@READBOOKIQBAL
@READBOOKIQBAL 4 ай бұрын
Great work ! Keep it up. Really appreciable !
@col_rod
@col_rod Жыл бұрын
Thank you, thank you and thank you! Finally I got to understand this topic. Really well explained as always. Again thanks!
@stephenadams6959
@stephenadams6959 Жыл бұрын
Another great well explained video. Thanks heaps for making it.
@meetingattender8132
@meetingattender8132 Жыл бұрын
Very informative like no other. Thank you!
@nt2548
@nt2548 10 ай бұрын
Good explanation. Thank you
@VirajKumarage-c2d
@VirajKumarage-c2d 11 ай бұрын
You are a god thank you. very nice video💙
@seangwright
@seangwright Жыл бұрын
Nice clear overview! If you needed to dynamically apply CORS configuration based on the request (which origin, is the request authenticated, ect...) can this be done with the built-in ASPNET Core "UseCors" middleware or should this be a completely custom built middleware?
@jub0bs
@jub0bs Жыл бұрын
As mentioned at 15:42, you're better off using an existing CORS middleware library, in particular because implementing CORS "from scratch" (unless you're intimately familiar with the protocol) is error-prone.
@vdrychyk
@vdrychyk Жыл бұрын
I have several POST endpoints in my controller, how can I allow CORS only for one of them and disallow it for others?
@joehernandez3231
@joehernandez3231 11 ай бұрын
You would create a named policy like he does in the video towards the end. The difference is you don't enable CORS everywhere with app.UseCors(...); instead you enable it on the endpoint with an attribute: [EnableCors("Policy1")].
@waqasmumtaz6109
@waqasmumtaz6109 Жыл бұрын
Liked And Already Subscribed Bro
@Tamer_Ali
@Tamer_Ali 11 ай бұрын
Thanks Anton for the awesome video how to load origins dynamically from database ?
@gt10i
@gt10i 7 ай бұрын
I have one question about the first part of the video. Unless I missed it, there was no preflight request for "Access-Control-Allow-Origin". Is it implicit? The server still has to first reply, and tell the browser that it allows CORS, right?
@ahmedifhaam7266
@ahmedifhaam7266 Жыл бұрын
are you reading my messages?? I literally just asked this question holy shi* man holy falgget blacakaty magati shiiii- Thank Yoouuuu
@marwanalakrass1688
@marwanalakrass1688 Жыл бұрын
Thanks for well explained video, can I use CORS to allow or disallow calls to my APIs from mobile apps ? if yes How to do so ?
@RawCoding
@RawCoding Жыл бұрын
Did you miss the part where it’s a browser security feature?
@marwanalakrass1688
@marwanalakrass1688 Жыл бұрын
@@RawCoding Seems I did, What is the best way to secure my APIs ?
@RawCoding
@RawCoding Жыл бұрын
Put it on a private network
@davestorm6718
@davestorm6718 5 ай бұрын
Still trying to figure out what CORS actually protects from: CORS is easily bypassed, for starters. As soon as you have the server set up to allow certain origins, methods, etc, then you no longer have the same security level (the session mechanism will be sent over just like normal). I don't get how this helps with security.
@codingbloke
@codingbloke Жыл бұрын
As someone not already familiar with CORS at this depth I found this a little too fast. Especially when it came to the allow credentials part where Creds and "cookies" seem to get conflated and from the point I was completely lost. Will have re-watch to see if I can unpick it.
@RawCoding
@RawCoding Жыл бұрын
if you implement cross origin authentication, you'll quickly realise how to fix it using that header.
@ahmedifhaam7266
@ahmedifhaam7266 Жыл бұрын
@@RawCoding for example if you use identity4 for your own api, client and server auth, i came across this issue, ?
@SergeiFedorov77
@SergeiFedorov77 Жыл бұрын
I've been reading and looking around to understand CORS and I got a pretty good idea about it now. I have a problem where the preflight, when my webapi is deployed to the server, always returns a 401 Unauthorized. I'm calling the webapi from a vue-site installed on the same server but different site and port. I used the app.useCors but it still didn't work when deployed. So then I expliclty put the headers for allowing origins but I still get the 401 from the preflight/OPTIONS request. In chrome I don't see the allow-origins header on for the options request and the console says the header is missing but I know for a fact that I send it. So I don't understand why the 401?? Oh, and all GET requests work just fine, it's the preflight with OPTIONS that get the 401.. Anyone has any idea about how to solve it?
@kpg7882
@kpg7882 9 ай бұрын
That minimal api apps are very confusing - I'm missing the part where OtherApp is calling an API. EDIT: Nvm - fetching a server app from otherapp console does this.
@Per-vh5ex
@Per-vh5ex Жыл бұрын
First 😄
Understanding .NET C# Heaps (Deep Dive)
28:23
Raw Coding
Рет қаралды 14 М.
ASP.NET Core Authorization  (.NET 7 Minimal Apis C#)
21:31
Raw Coding
Рет қаралды 40 М.
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
What you should know about Threads in .NET
14:52
Raw Coding
Рет қаралды 8 М.
The RIGHT Way To Use HttpClient In .NET
11:46
Milan Jovanović
Рет қаралды 65 М.
How To Solve CORS Error? Learn CORS in 6 mins
6:32
Etisha Garg
Рет қаралды 10 М.
Don't Use Polly in .NET Directly. Use this instead!
14:58
Nick Chapsas
Рет қаралды 75 М.
Why replace if statements with Objects
22:20
Raw Coding
Рет қаралды 8 М.
.NET 8  .🚀🔥:  Understanding CORS with ASP.NET
14:06
Mohamad Lawand
Рет қаралды 10 М.