Understanding CORS with ASP.NET Core C#

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

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 6 ай бұрын
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 Жыл бұрын
Good explanation. Thank you
@VirajKumarage-c2d
@VirajKumarage-c2d Жыл бұрын
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.
@waqasmumtaz6109
@waqasmumtaz6109 Жыл бұрын
Liked And Already Subscribed Bro
@Tamer_Ali
@Tamer_Ali Жыл бұрын
Thanks Anton for the awesome video how to load origins dynamically from database ?
@gt10i
@gt10i 8 ай бұрын
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?
@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 Жыл бұрын
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")].
@davestorm6718
@davestorm6718 7 ай бұрын
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.
@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
@ahmedifhaam7266
@ahmedifhaam7266 Жыл бұрын
are you reading my messages?? I literally just asked this question holy shi* man holy falgget blacakaty magati shiiii- Thank Yoouuuu
@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 10 ай бұрын
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 😄
Brutally honest advice for new .NET Web Developers
7:19
Ed Andersen
Рет қаралды 329 М.
Background Jobs in ASP.NET Core
18:35
IAmTimCorey
Рет қаралды 61 М.
Sigma girl VS Sigma Error girl 2  #shorts #sigma
0:27
Jin and Hattie
Рет қаралды 124 МЛН
Thank you mommy 😊💝 #shorts
0:24
5-Minute Crafts HOUSE
Рет қаралды 33 МЛН
I'VE MADE A CUTE FLYING LOLLIPOP FOR MY KID #SHORTS
0:48
A Plus School
Рет қаралды 20 МЛН
Understanding .NET C# Heaps (Deep Dive)
28:23
Raw Coding
Рет қаралды 14 М.
Don't Use Polly in .NET Directly. Use this instead!
14:58
Nick Chapsas
Рет қаралды 78 М.
Dependency Injection, The Best Pattern
13:16
CodeAesthetic
Рет қаралды 920 М.
All Rust features explained
21:30
Let's Get Rusty
Рет қаралды 341 М.
How Structured Logging With Serilog Can Make Your Life Easier
13:36
Milan Jovanović
Рет қаралды 56 М.
What is the difference between BackgroundService and HostedService?
17:44
Saeed Esmaeelinejad
Рет қаралды 4,8 М.
Sigma girl VS Sigma Error girl 2  #shorts #sigma
0:27
Jin and Hattie
Рет қаралды 124 МЛН