Create a server for your Unity game using .NET Core (Part 2)

Create a custom server using .NET Core and host it in the cloud to act as your games backend. A custom server specifically designed for your game gives you the greatest freedom to deliver your ideal product.
Go watch part one: • Create a server for yo...
In this video we learn about:
Database management using an ORM (Entity Framework)
Authentication & Authorization
Json Web Tokens (JWT)
A bunch of common attack vectors and security tricks
Password security (hashing & salting)
Environmental variables
A custom server you can provide your game with features such as:
Achievements, leaderboards, synced player data, guilds, friends lists, real time chatting, loot boxes, matchmaking, player progress, and much much more.
Full project on my Patreon: / tarodev
This tutorial is information dense... there's a huge amount to get through, so buckle up and get ready to learn.
❤️ Become a Tarobro on Patreon: / tarodev
=========
🔔 SUBSCRIBE: bit.ly/3eqG1Z6
🗨️ DISCORD: / discord
✅ MORE TUTORIALS: / tarodev
0:00 - Overview
0:40 - Adding Newtonsoft
1:50 - Database (ORM) / Entity Framework
3:15 - User Model
7:45 - Pushing Models/Tables to DB (Navicat, Powershell)
10:23 - Adding Data to Tables
12:35 - Authentication
14:23 - Authentication Controller
16:39 - Authentication Service
17:38 - PW Salt & Hash
22:11 - JWT
32:10 - Hero Refactor
34:12 - Adding Authentication package
37:33 - Authorization
38:07 - Creating CreateHeroRequest
41:54 - Testing CreateHeroRequest
45:30 - Advanced Authorization / Changing Hero Name
50:05 - Closing

Пікірлер: 124

  • @doku1922
    @doku19222 жыл бұрын

    This is absolutely amazing. Love your work!

  • @iMakeGames
    @iMakeGames2 жыл бұрын

    Wonderful series it was 👏🏼👏🏼 Would love to watch the dedicated socket server with unity

  • @TheAwesomeTrunk
    @TheAwesomeTrunk Жыл бұрын

    This tutorial series is incredibly helpful. I learnt so much, especially because you managed to cover so many different subjects, and because you frequently explain why certain things are the way they are. The humor here and there was appreciated as well. Thank you for these videos!

  • @Tarodev

    @Tarodev

    Жыл бұрын

    So glad you enjoyed it 🙏

  • @angelgamingco
    @angelgamingco Жыл бұрын

    We were unsure how to setup our backend for our newest release....very frustrating having 90% of it done and then not knowing how to do the backend... We tried many solutions but this is amazing and extremely useful and has taught us a lot!

  • @zenobiusztasak8604
    @zenobiusztasak86042 жыл бұрын

    I am so glad I have found you, consider yourself as the best

  • @DocuFlow
    @DocuFlow10 ай бұрын

    Excellent coverage, all the important bits and none of the guff. Thank you!

  • @DocuFlow

    @DocuFlow

    10 ай бұрын

    Have you thought of SignalR for game comms? I'm weighing the pro and cons against controller get and posts.

  • @KazimierzLuska
    @KazimierzLuska2 жыл бұрын

    Thanks for the video it is really good to see a simple example of an auth flow usually they explode your head a bit, but after watching this tutorial I will actually try to set my own server up :D Also hell yeah for a deploy episode !!

  • @Archimagus
    @Archimagus2 жыл бұрын

    Great series so far. I really like the super condensed, (I expect you to know some basic programming already) level of tutorial here. So hard to find advanced topic tutorials that don't treat the audience like a complete newbie. I want to try and adapt this to use gRPC for transport rather than HTTP. I'm not sure which parts are going to be difficult though, some of it should transfer nicely, but I suspect there is going to be some parts that aren't as nice as "add this hook and it works"

  • @Serotonindude
    @Serotonindude2 жыл бұрын

    absolutely great video! i was looking for videos just showing me how to start with authentication/authorization and all of them are extremely long and don't just show me what i wanted to know... i knew the rest about asp.net core webservices, but i needed something to get started with those two topics. thank you very much! keep up the pace, everything you need to get started is in there. if it is to fast for someone, you can always pause or rewind a bit... 🥳

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    You sound like my perfect customer 😊

  • @viba_dev
    @viba_dev3 ай бұрын

    Great series, please make a part 3!

  • @hamzzashaffi
    @hamzzashaffi2 жыл бұрын

    Super helpful! Great work!

  • @mahmoudabdallah3942
    @mahmoudabdallah39422 жыл бұрын

    Nice tutorial 🔥 Keep going

  • @FoursPower
    @FoursPower Жыл бұрын

    First of all fantastic Video! Thank you, i learned a lot from your Videos so please keep up that great work

  • @angusmf

    @angusmf

    Жыл бұрын

    Legend!

  • @8-----3

    @8-----3

    11 ай бұрын

    Thanks you a lot

  • @sinuetv

    @sinuetv

    4 ай бұрын

    Next time I should read the comments first... Just found out the same and wanted to leave a comment. But you already did :) Thanks

  • @dysxleic4273
    @dysxleic42732 жыл бұрын

    best game dev channel ever

  • @ChrisMarshallUS
    @ChrisMarshallUS Жыл бұрын

    Thank you this was very useful, have a server up and running and working with Postman thanks to the advise.

  • @Tarodev

    @Tarodev

    Жыл бұрын

    Glad it was usefull :)

  • @danielmolineromuller166
    @danielmolineromuller1662 жыл бұрын

    Amazing! Looking forward to part 3!

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Maybe a part 3 😂 glad you enjoyed it

  • @kiba1704

    @kiba1704

    Жыл бұрын

    @@Tarodev Do it :)

  • @tr0sty
    @tr0sty11 ай бұрын

    An excellent lesson. It's a shame there's no next part

  • @94Kansas
    @94Kansas2 жыл бұрын

    Great videos! It would be nice if we could see the deploy part to connect with online. This part it's always missing on internet. Thank you for all this videos!

  • @micaiahstevens8840
    @micaiahstevens88402 жыл бұрын

    This is a GREAT series, and a crash course is this material. Tried a few times to get my head around post and get, and this makes it simpler and nice. Would love to see the Unity side of this part two. It makes SOME sense, but prob a LOT of unity stuff to tie it all together.

  • @micaiahstevens8840

    @micaiahstevens8840

    2 жыл бұрын

    Also, maybe I am lame, but WOW the database and server and hooking them up. Going to try, but NOT sure how you did all the azure stuff and sql and using those tools. Pushing syncing and so forth. Would love to see a website/server running in something, and how you get a 'test' server up. With your unity clients connecting

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    @@micaiahstevens8840 I'll give this server side a break for a bit, do some unity specific stuff and come back to make a devops style video which will include deployment, tooling, dB's etc

  • @micaiahstevens8840

    @micaiahstevens8840

    2 жыл бұрын

    No worries, I LOVE your unity tutorials. You are even getting mentions all over for your 2D Character controller. Were more thoughts that requests.

  • @neolynxer

    @neolynxer

    Жыл бұрын

    @@Tarodev would be awesome! Although it was 10 months already, i'm still waiting for that one.

  • @mracipayam

    @mracipayam

    11 ай бұрын

    @@Tarodev Dude come on we need that course! it's been 1 year break come on! :D

  • @monishdhayalan2552
    @monishdhayalan25522 жыл бұрын

    just saving this for my future server enthusiast

  • @wizzzle2948
    @wizzzle29482 жыл бұрын

    ayyy, there it is, the next hour is going to be good :D

  • @codingTheFuture
    @codingTheFuture2 жыл бұрын

    Excellent tutorial. Thank you so much!! Would love to see more around the client/server interactions... Client (server authoritative spawning in objects, player movement, anti cheat) -- Server (Matchmaking, leaderboards, in-game store, player statiics (time played, items purchased, etc...) .....Just a few things.. ha! Thanks again!!

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Great video ideas. I'll write them down 😊

  • @bluzenkk
    @bluzenkk2 жыл бұрын

    wonderful~ thanks for the hard work~

  • @Jim-tv2tk
    @Jim-tv2tk Жыл бұрын

    Very helpful, thanks!

  • @Rubidev
    @Rubidev2 жыл бұрын

    I am not a fan of long tutorials because I feel the tutor wastes time in between but your videos are so fast paced that I become so eager to watch them over and over even the lenghtiest ones. Good job brother. You are on the right track. Thank you so much for your extremely helpful videos.:)

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Ah man, you have no idea how much I enjoyed reading your comment. I really didn't want to release a video this long, so it's great to hear it's still acceptable. Thank you 🙏

  • @Rubidev

    @Rubidev

    2 жыл бұрын

    ​@@Tarodev With these scheduling and partitioning stuff you already show how much you care for your audience. I would watch much longer ones with eyes wide open not to miss out on your points.👀

  • @musiquecontrebasse5339
    @musiquecontrebasse53392 жыл бұрын

    Thanks for the video Tarodev ! I love it ! But i have a little question, every web server for Unity is using .NET Core ? Or we can create this web server for Unity with Angular, Nextjs, Laravel or any other framework ?

  • @ishan9050
    @ishan90502 жыл бұрын

    After going through your Unity Code Optimization Video, I went through your channel's content and I HAVE to say, this is by far one of the most underrated channels on unity out here. Thank you so much for bringing these contents to us. I haven't even watched this but I am really excited to go through this and all your other tutorials. One Question: I'm a beginner-intermediate dev here, with no knowledge of Networking whatsoever. I use Photon(PUN) for creating multiplayer games but I really feel disconnected from its behind-the-scenes workings. I want to create a simple game without using PUN or external APIs so I can better understand the concepts and decide when to use one and when not to. Some devs and posts also suggested that I don't need photon for simple turn-based games. Some suggested that I should learn socket programming and networking and it's worth the time and effort. I simply can't get the answer to whether I should stick to Photon or should I learn socket programming or something else. So can you guide the correct way from a game developer's perspective? If you can create a course for such even behind a paywall, it will be amazing to learn from an instructor like you. And most of us would agree with that.

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    If you don't like the disconnect you feel from the behind the scenes workings (of PUN), a custom server is really your only option. Assuming you decide to learn how to do it and you don't finish your game, you've still learned an incredibly useful skill which is beneficial on any developer resume. The server I'm building here is more of an administration server. Data handling etc, similar to that of firebase or playfab. You'd use this on top of photon for example. Saying that, you can certainly add photon part into this server using sockets. Signalr would work for slower paces games. If you need low latency game play look into LLAPI

  • @ishan9050

    @ishan9050

    2 жыл бұрын

    ​@@Tarodev Thanks. This will help.

  • @ilyasyrtlanov5882
    @ilyasyrtlanov5882 Жыл бұрын

    Great guide! Btw, instead of using navicat you can use Database tab in Rider to connect and view/edit your db.

  • @Tarodev

    @Tarodev

    Жыл бұрын

    Oh, damn! I'll try that out, thanks!

  • @martid-wo7je
    @martid-wo7je Жыл бұрын

    Hi, this is top content, thank you. Say, do you have any plans on covering using Addressables with custom web api server rather than Unity CDN?

  • @erythreas34
    @erythreas343 ай бұрын

    Never heard anyone say Sequel for SQL. I was confused until i remembered we talking about DBs

  • @kingofroms7224
    @kingofroms72242 жыл бұрын

    Thank you so much

  • @briansilva3765
    @briansilva37654 ай бұрын

    Hey there, great tutorial, but I got lost when you went to Navicat, what exactly did you add there? The project or the localhost connection?

  • @blazehunter09
    @blazehunter096 ай бұрын

    I really like both Part 1 and Part 2, the thing is I am bit concert about position sync I don't think it's a very good idea to use HTTP requests for that but it looks good for a LoginServer in an MMORPG, I've learned a lot, thanks!

  • @Tarodev

    @Tarodev

    6 ай бұрын

    Yes, this is not so much for realtime (although you can use sockets right from your http server), but server administration. Syncing player data, handling authoritative actions, storing world data, etc.

  • @blazehunter09

    @blazehunter09

    5 ай бұрын

    @@Tarodev Would it be a good idea to use this as a login server and instead of sending data from my game with TCP (reliable messages) instead use HTTP for example: - Heartbeat - Inventory update

  • @vrgamestudio294
    @vrgamestudio294 Жыл бұрын

    This is really great content but do you have a video about making an azure account and setting up your database and hosting (from a unity dev point of view), including dos and don't s around pricing implications?

  • @Rubidev
    @Rubidev2 жыл бұрын

    I wonder your background. I mean this is all amazing stuff, butt how one could have been learning these stuffs for years. I don`t usually come up with such crystal clear explained information on seatch engines.

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    I've been building servers for a day job for many years 😊

  • @meuix3218
    @meuix32182 жыл бұрын

    "so the server can now say.. eew.. fuck you, that's invalid" I love you Tarodev

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Always send respectful requests to your server 😜

  • @CSPlayerDamon
    @CSPlayerDamon2 жыл бұрын

    Hey, nice topic! What is the main advantage to building a server in .NET Core in a different project? I and some friends have been building a complex card game and our logic, which spans thousands of lines of code, utilizes Unity's API.. so basically, components on top of GameObjects (just how you would typically write a Unity game). I presume your approach focuses on a "Master Server" which handles authentication, lobbies, matchmaking etc and deploys "Game Servers", which would be typically written in Unity. Why wouldn't' you build the "Master Server" as a Unity application as well? Is it performance-related or is it simply easier to write? I've built our master server in Unity with sockets, maintaining a constant bidirectional connection with the player; makes it easier to also send notifications. Would there be any major benefits if I switched it to a RESTful API? Is it that much of a bottleneck to keep active connections to the master server as opposed to doing things only by [HTTP] requests?

  • @emiel04
    @emiel042 жыл бұрын

    I have 2 questions. 1. In unity I keep track of my token & refreshtoken using playerprefs. Is this a good way to store it? 2. How could I verify an action is allowed, for example, setting the highscore, so only the client can send the request, so it can't be done manually via postman or something, so the player can't cheat when they have their token. How would this be possible? Also something i've found very useful for http request is the free asset RestClient, it's also a wrapper for UnityWebRequests which uses promises and alot of functionality like catch, finally etc. By the way, thumbs up, really loving your channel! keep up the good work.

  • @sparkestic1238
    @sparkestic12382 жыл бұрын

    a tutorial on 2d procedural animation will be great sir.

  • @user-pm1zn3pm3g
    @user-pm1zn3pm3g8 ай бұрын

    Hello, great video, what is the right way to attach header in unity web request with authentication and bearer key? Like in postman wont work...

  • @uRamPlus
    @uRamPlus Жыл бұрын

    Ur amazing

  • @Tarodev

    @Tarodev

    Жыл бұрын

    No you are

  • @SuperRomannik
    @SuperRomannik2 жыл бұрын

    Could you make a tutorial on adding a socket to the server and accessing the server through the client

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Won't be for a while. I'm the meantime look into signalr

  • @jakubreichman
    @jakubreichman2 жыл бұрын

    I am just going through this process in my own project with custom classes and it seems like Unity doesnt like having only properties (change done at 1:23) in the dll. After building my own dll, having only properties seems to be causing some errors in the managed dll once loaded in unity, particularly this error seems to appear : "Unable to load attribute info on field {classInfo+fieldName}>k__BackingField. Are you missing a reference?" It seems like this error dissappears once I make the field + property combo. I am not quite sure if this will actually cause some trouble down the line as I havent gotten that far yet, but it's something that I wanted to mention in case someone runs into this issue. And I hope you are feeling better already, get well soon!

  • @igd1591
    @igd1591 Жыл бұрын

    What if the user adds a new hero but his JWT still has the old list of heroes, shouldn't it be updated somehow?

  • @mypaxa003

    @mypaxa003

    Жыл бұрын

    I would say it is bad practice to store such data in jwt. In my opinion, It should only be used for authorization.

  • @BrandonFerrentino
    @BrandonFerrentino8 ай бұрын

    So with this knowledge I should be able to GETand POSTfiles that I want to be displayed in my game. For instance I want to share a screen shot of my game world in a social hub i created in Unity. other users will be able to GET and see the file and be able to POST an upvote or downvote on it.

  • @DenVe234
    @DenVe234 Жыл бұрын

    Hey! Great tutorial! I have a few questions: What object am I supposed to as argument for the Post method? Is it the AuthenticationRequest with the username and password? If so, how can I make sure json can serialize this object? Right now I'm getting the error: Could not resolve type with token 01000012 Thanks in advance :)

  • @DenVe234

    @DenVe234

    Жыл бұрын

    I fixed it for now by just using the Jsonutility.ToJson method. I changed the class values from properties to normal values but it seems to work now

  • @Emptrix
    @Emptrix2 жыл бұрын

    Am I right to say that part 1 covered only a local connection with the game client and server? Because I did not see the part where we indicate the dns or ip address of the server, so its basically a local database for now until we reach the cloud portion?

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Correct. In part one we used localhost, that will be replaced with your hosted endpoint.

  • @fatpizza482
    @fatpizza4822 жыл бұрын

    Do you do any contract work by any chance. Im based in Australia and I noticed you are too.

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    I do not, sorry mate. Happy to help with stuff if you pop into discord though

  • @fatpizza482

    @fatpizza482

    2 жыл бұрын

    @@Tarodev Cheers mate, have you got a link for your discord. Im happy to pay for advice and help if it requires a bit of work.

  • @tomkc516
    @tomkc5162 жыл бұрын

    "Get your tip wet"

  • @ABC-cr9mi
    @ABC-cr9mi Жыл бұрын

    Your tutorials are extremely informative I really appreciate them. But for this one I think it would have been better to have a very very basic game and then attempt to create a server for it. because if all you show is server code, I'm lost in the land of abstraction, I have no idea how any of this ties to an actual thing that I do in-game, and this makes me unable to pay attention to anything being said or shown. It would have been better to first show something in-game and then be like "you see this thing in front of you (walking, shooting, registering player score...etc), this is how it's carried out on the server end (then proceed to show the server code that allows it to happen)". I think it's extremely important to 'anchor' people to something they can easily understand before talking about abstract concepts like what's happening in the server.

  • @unhott1893
    @unhott1893 Жыл бұрын

    Can this server be refactored to use websockets? I imagine if I want to have a boardgame where a server waits for an action to be sent to the server, then communicate that action to other players, that it would need websockets.

  • @Tarodev

    @Tarodev

    Жыл бұрын

    You certainly could. For primative games you could quite easily use something like signalr. For more advanced realtime game play you may want to look into using a service like netcode by unity.

  • @rasmushenkel4444
    @rasmushenkel4444 Жыл бұрын

    Does anyone have an example of how the connectionstring might look like? I'm trying to connect using something like this: Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword; But it wont let me...

  • @Sumrov

    @Sumrov

    Жыл бұрын

    string connectionString = "Server=localhost;Database=master;Trusted_Connection=True;";

  • @Ky0JRDenny
    @Ky0JRDenny2 жыл бұрын

    Well, its better to use UserManager from EF Core

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Woops, I was meant to add Identity/UserManager as a google keyword on the video! But wanted to provide a basic understanding of token generation and validation in it's basic form. That way it's valuable across all frameworks and languages.

  • @bujin1977
    @bujin19772 жыл бұрын

    Ok, that's it. Next time I build an application, I'm gonna have my server return "fuck you, that's invalid!" when they do something wrong.

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Might not go down too well 😜

  • @wizzzle2948
    @wizzzle29482 жыл бұрын

    I have a weird problem, since i changed to Newtonsoft in Unity i get a very long error message when accessing the server through your HttpClient script. The message starts with "TypeLoadException: Could not resolve type with token 01000012". I also got your project from patreon, got it to run on my machine but still the same error... can you help me? EDIT: Works perfectly fine on another Computer

  • @wizzzle2948

    @wizzzle2948

    2 жыл бұрын

    i might want to add, that when i send a get request through the browser, it works perfectly fine, its just a problem in unity

  • @beatsandpumpkins1661

    @beatsandpumpkins1661

    2 жыл бұрын

    I have same problem. How to repair it in unity? Somethnig with dll or?

  • @wizzzle2948

    @wizzzle2948

    2 жыл бұрын

    @@beatsandpumpkins1661 i dont acutally know, but on another computer it works just fine

  • @beatsandpumpkins1661

    @beatsandpumpkins1661

    2 жыл бұрын

    Create private fields for each property in given class fix the problem: private string? id; private string? username; public string Id { get { return id; } set { id = value; } } public string Username { get { return username; } set { username = value; } }

  • @jasonbartlett1357

    @jasonbartlett1357

    Жыл бұрын

    @@beatsandpumpkins1661 Thanks for this. I was also getting the following error in Unity, but this suggestion seemed to fix it: "Unable to load attribute info on field SharedLibrary.Player::k__BackingField. Are you missing a reference?"

  • @StefanNagelAG
    @StefanNagelAG2 жыл бұрын

    Hi Tarodev, When i do a AuthenticationRequest to login with postman is no problem. Works fine. But, when i do a AuthenticationRequest to login in unity, then it will end in a BadRequest. When i'm debugging it, then i see it jumps into the Login(..) in AuthenticationController. But the request entries are empty (username and password = null). What can i do?

  • @jerms_mcerms9231

    @jerms_mcerms9231

    Жыл бұрын

    I can't even get unity to call the server register function...

  • @adnanshaukat412

    @adnanshaukat412

    5 ай бұрын

    Hey did you fix this? been an year and I am also stuck on this... both are null but on unity side I am sending the right values.

  • @DalamarTD7
    @DalamarTD72 жыл бұрын

    Does anyone have recommendations for free alternatives to Navicat and Azure?

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    I used DBeaver before navicat. Azure is Microsoft's cloud platform which offers thousands of products. They do have a free Web app tier.

  • @DalamarTD7

    @DalamarTD7

    2 жыл бұрын

    Thanks bub

  • @KamikazeXeX

    @KamikazeXeX

    Жыл бұрын

    I realize this was a while ago but if you're on Windows then HeidiSQL is a great, free, SQL client which supports a good handful of common database types such as MariaDB, MySQL, Microsoft SQL, PostgreSQL and SQLite.

  • @AreksDesu
    @AreksDesu2 жыл бұрын

    "So nya~w..."

  • @bumbowo
    @bumbowo2 жыл бұрын

    Hellu

  • @CREEPPAK
    @CREEPPAK Жыл бұрын

    I do like your asp.net core series, but don't you think Sql is too ancient to be used in 2022?

  • @maksymiliansroka
    @maksymiliansroka2 жыл бұрын

    Isn't it called ".NET" now and not ".NET Core"?

  • @bity-bite

    @bity-bite

    2 жыл бұрын

    Yes, it has been rebranded to just .NET Not sure why he still calls it .NET Core

  • @Serotonindude

    @Serotonindude

    2 жыл бұрын

    there's nothing wrong to call it .NET Core 5 or 6 even if they are called .NET 5 & 6 officially... it still helps to seperate the technology stack you mean until .NET Framework died...

  • @bity-bite

    @bity-bite

    2 жыл бұрын

    @@Serotonindude .NET Framework is known for .NET 4.X and .NET Core is known for .NET X, so IMO it is better to stick with the known and most used naming

  • @Serotonindude

    @Serotonindude

    2 жыл бұрын

    .NET Framework is known for hundreds of versions up to 4.8.x ... .NET Core had 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1 also with the third version number for fixes... so... there is nothing wrong to be explicit about .NET 5 & 6 for just a little longer... you are nitpicking here, IMO 😁 everyone in the field will exactly know what you are talking about...

  • @bity-bite

    @bity-bite

    2 жыл бұрын

    @@Serotonindude It is a nit-pick yeah, it's just that I see that not using the "Core" word looks clearer

  • @dormammumedia1227
    @dormammumedia1227 Жыл бұрын

    Your authorization by Bearer token does not work, I tried your entire project up and down, authorization by token does not work!!!!

  • @TurkiKAlzahrani

    @TurkiKAlzahrani

    Жыл бұрын

    Make sure that app.UseAuthentication() is called before app.UseAuthorization(). Hope this helps.

  • @dormammumedia1227

    @dormammumedia1227

    Жыл бұрын

    @@TurkiKAlzahrani Not help

  • @jasonbartlett1357

    @jasonbartlett1357

    Жыл бұрын

    @@TurkiKAlzahrani OMG!!! I spent 2 days trying to figure out why it wasn't working! And this was the stupid reason. I swear I looked at that before and was like, it shouldn't matter right? But I've never done .NET dev before, so I had no idea. And troubleshooting an issue like this is a major pain, cause like you send the POST and it never even gets to the controller so like there's nowhere to put a breakpoint or debug log to figure it out. This is the second fix that I found in the comments, so I guess the moral of the story is, read the comments before going off and watching other YT videos. Anyhow, thank you!

  • @adnanshaukat412

    @adnanshaukat412

    5 ай бұрын

    @@TurkiKAlzahrani I just wasted a whole day on this. No matter what I did, it said unauthorized. Man, thanks for this comment. It worked!!! Maybe Turo didn't show in the video so we should correct it by ourselves and learn more about what JWT is. I am so releaved

  • @colliemollie
    @colliemollie Жыл бұрын

    wow thank you for your tutorial 🥲you are amazing

  • @Tarodev

    @Tarodev

    Жыл бұрын

    Thanks Collie