ASP.NET Core JWT Authentication Tutorial (.NET 7 Minimal Apis C#)

Поділитися
Вставка
  • Опубліковано 23 лип 2024

КОМЕНТАРІ • 40

  • @narminalieva4694
    @narminalieva4694 Рік тому

    You are so great. Also you are reading my mind, whenever i need some topic next day it’s on your channel 💥

  • @ricardothomas3779
    @ricardothomas3779 Рік тому

    Great video Anton!

  • @josepvg
    @josepvg Рік тому +1

    Amazing video, thanks :)

  • @cocoscacao6102
    @cocoscacao6102 Рік тому +7

    As always, great vid. I'd love to hear about C# streams (in depth). Have you ever planned to cover that topic?

    • @RawCoding
      @RawCoding  Рік тому +4

      Not yet, I’ll keep it in mind.

  • @sorinvasiliu
    @sorinvasiliu Рік тому

    baller! ty for this

  • @piotrc966
    @piotrc966 Рік тому

    Very good content.

  • @icemanja
    @icemanja 7 місяців тому +1

    Great content Anton,
    Could this private/public key setup be used in a microservice architecture where the identity app generates the token with the private key and other services use the public key the authenticate the jwt token?

  • @sadafziya5636
    @sadafziya5636 6 місяців тому

    thanks for your video.
    if i want to implement microservice and have authentication too, can I use this method ?
    Assume I have two project one is Security other one is Parts ... before user can to use parts webservice , have to be authenticate.

  • @smokeraven
    @smokeraven Рік тому +1

    It would be handy to have a slide or a quick minute that explains the dotnet new commands (or whatever) to setup the base projects shown.
    Love the vids and very helpful.

    • @RawCoding
      @RawCoding  Рік тому +2

      thank you, if you're trying to learn jwt's I expect you are fully capable of figuring out how the dotnet command line tool works

    • @smokeraven
      @smokeraven Рік тому

      @@RawCoding in my case it's exactly that I haven't been using the code IDE but it turns out to be pretty simple 🤓

  • @kleberperez2580
    @kleberperez2580 Рік тому +1

    Anton, Thanks for the video, How did you get the jwtString value?

  • @dannyjiang98
    @dannyjiang98 Рік тому +2

    很好的视频

  • @mohsenrafiei3432
    @mohsenrafiei3432 Рік тому +1

    Do you have any program to teach Duende Identity Server in next videos?

    • @RawCoding
      @RawCoding  Рік тому

      We will be covering openiddict

  • @kaznnknzn875
    @kaznnknzn875 Рік тому

    Great as always! But what about two factor authentification ? Maybe innthe future we will see vide about it?:) As example how setup Identity server with 2fa

    • @RawCoding
      @RawCoding  Рік тому +2

      Maybe 2fa, but it has nothing to do with identity server, so you won’t see the 2 together

  • @MrJonnis13
    @MrJonnis13 Рік тому +1

    Thank you for your great and in-depth video.
    A question on how the External validation of the Token using the public key 29:04:
    We sending to External the Token which consists of Plain Data (Header + Payload) plus the signature (encrypted Plain Data) generated on Auth Server side.
    On External side then, we load the Token, and *signature + Public key = hash1* . Then we get the *Plain Data + WHAT = hash2* .
    If *hash1 == hash2* , validation passes and we are Authenticated. So my question is: what is this *WHAT* on the above formula ? Is this the public key *OR* some hashing algorithm that was used also in Auth Server side before it encrypted it ?

    • @RawCoding
      @RawCoding  Рік тому +2

      I didn't explain this point very well.
      Server
      digest/hash = sha256(data).
      signature = encrypt(hash, privateKey)
      token = data + signature
      External
      digest1/hash1 = sha256(data)
      digest2/hash2 = decrypt(signature, publicKey)
      valid = hash1 == hash2
      Encryption - private decrypts, public encrypts
      Signing - private encrypts, public decrypts
      How this interchanges I have no clue.

    • @MrJonnis13
      @MrJonnis13 Рік тому

      @@RawCoding Thank you for the reply and the clarification. So this "What" is actually the *sha256* algorithm.

  • @joshem32
    @joshem32 Рік тому +1

    Which one do you recommend jwt or cookie authentication with spa?

    • @RawCoding
      @RawCoding  Рік тому +1

      Cookie 🍪

    • @MinhNguyen-zx8me
      @MinhNguyen-zx8me Рік тому +1

      @Raw Coding: may I know the reason why ? I heard so many people saying that cookie is not mobile friendly, and they suggest to use jwt token instead.

    • @RawCoding
      @RawCoding  Рік тому +1

      @@MinhNguyen-zx8me cookies are automatically handled by browsers, not httpclients - your mobile app will programmed with an httpclient. For mobile it doesn't matter you'll have to do manual work for both cookies and tokens. For browsers cookies are handled securely automatically.
      So Cookies.

  • @mohamedesmaeil2236
    @mohamedesmaeil2236 Рік тому +1

    excuse me , can I use JWT without identity because it doesn't cover my needs in authorization

    • @RawCoding
      @RawCoding  Рік тому +1

      Of course

    • @mohamedesmaeil2236
      @mohamedesmaeil2236 Рік тому +1

      @Raw Coding I will be appreciate if you send link about implement that

    • @RawCoding
      @RawCoding  Рік тому +1

      Watch the identity management video in the playlist.

  • @mahmudx
    @mahmudx Рік тому

    Please create videos on (Identity, JWT) with multi-tenancy.

  • @abdulnaveed4984
    @abdulnaveed4984 Рік тому +1

    how to use jwt with external authentication e.g: aws forgate

  • @weamhaleemi4984
    @weamhaleemi4984 Рік тому

    Gg first half was understandable then you dived into the complex code and started doing random stuff and Im lost

  • @abuzeromohammed3386
    @abuzeromohammed3386 Рік тому

    I need funny request