OAuth 2.0 & 2.1 Explained

Sdílet
Vložit
  • čas přidán 23. 08. 2022
  • OAuth 2.0 and OAuth 2.1 explained. JWT in OAuth
    Patreon 🤝 / raw_coding
    Courses 📚 learning.raw-coding.dev
    Shop 🛒 shop.raw-coding.dev
    Discord 💬 / discord
    Twitter 📣 / anton_t0shik
    Twitch 🎥 / raw_coding
    📃 Source Code / raw_coding
    ⏭ ASP.NET Core JWT Authentication • ASP.NET Core JWT Authe...
    📀 Authentication and Authorization Playlist • ASP.NET Core Authentic...
    ⏮ ASP.NET Core Angular Authentication • ASP.NET Core Angular A...
    🧐 oauth.net/
    #oauth #oauth2 #aspnetcore

Komentáře • 73

  • @AnsisPlepis
    @AnsisPlepis Před rokem +5

    11:35 perfectly sums up a big part of my confusion on OAuth. awesome video

  • @pabloduarte4470
    @pabloduarte4470 Před rokem +6

    Best coding channel by far.

  • @georgekopadze791
    @georgekopadze791 Před rokem +2

    Clearly explained. Well done and of course thank you for your effort

  • @user-rr5pc5bx1c
    @user-rr5pc5bx1c Před rokem +1

    Very cool videos! Thanks for the detailed explanation of all this mess, in my head.

  • @michaelestrinone2111
    @michaelestrinone2111 Před rokem

    This video is so helpful! Thank you

  • @unhandledexception1948
    @unhandledexception1948 Před rokem +1

    love the bit of humour dispersed throughout this complex spec
    😀

  • @sabashavidze4990
    @sabashavidze4990 Před 19 dny

    great explanation with details 🚀

  • @cicerofoscarini8890
    @cicerofoscarini8890 Před rokem

    Hey man! Nice video like always and... nice new hair :)

  • @akamamin3197
    @akamamin3197 Před rokem +1

    thank you for your effort.

  • @DmitryKochanowski
    @DmitryKochanowski Před rokem

    Thank you. Good job.

  • @vvkim20
    @vvkim20 Před 3 měsíci

    the best oauth explain

  • @kenrazo2533
    @kenrazo2533 Před rokem

    woohooo super great!

  • @stickyamp5996
    @stickyamp5996 Před měsícem

    This video was really cool. Easy to follow and understood very well oauth2. Can you do the same (if not already done) with saml, openId connect and pretty much any other popular auth protocol? I'd love to watch that.

  • @uRamPlus
    @uRamPlus Před rokem +1

    Oh shit u got that fresh cut? 😊😝 thanks for this lecture! liked 👍

  • @daviddevon
    @daviddevon Před rokem +3

    With the advent of "cookiepocalypse" breaking frontend communication with AzureAD I would love to see you do a video with a SPA and API (e.g. React ASP) using Backend for Frontend pattern to mange AuthN/Z using AzureAD. I just discovered your work recently and it is such a big help. I have a lot of videos to watch :) Thanks

    • @RawCoding
      @RawCoding  Před rokem +1

      Check my more recent videos on OAuth

    • @serg1778
      @serg1778 Před 4 měsíci

      in some of your videos i heard that OpenId gives you id and refresh in addition, which contains user data (claims).Now i'm confused a bit because here you said that access token gives access to user's data as well.Maybe I misunderstood. @@RawCoding

    • @RawCoding
      @RawCoding  Před 4 měsíci +1

      Yep access token (OAuth) gives you access to api, refresh tokens are part of OAuth still and can be used to refresh access tokens. OpenId introduces id tokens which Identify the user (aka authentication)
      Claims can go in all tokens (only in oidc, because the spec says all tokens should be jwt tokens). Oauth doesnt say that tokens need to be jwts, but rather can be any value (so more of a reference rather than a payload)

  • @LouisWaweru
    @LouisWaweru Před rokem +2

    🔥 18:47

  • @_Grunty_
    @_Grunty_ Před 9 měsíci

    Thanks for such a didactic explanation.
    FWIW, on slide "Flow - PKCE (1)", see around 24:10, your exposition won't get any better if you fix that typo in: "[code_challange + method]". But you might want to fix it anyway 😉

  • @shreyasjejurkar1233
    @shreyasjejurkar1233 Před rokem +5

    I know u already have series on auth. But would love to see how to integrate aspnetcore api with Azure app registrations things including diff scopes and things.

  • @DSD3mon
    @DSD3mon Před rokem +2

    18:56 LOL
    Very informative video, though, thanks a lot

    • @RawCoding
      @RawCoding  Před rokem +1

      Cheers, glad you enjoyed it)

  • @medzik1993
    @medzik1993 Před 7 měsíci

    f*cking best video on youtube !

  • @shahzeb5130
    @shahzeb5130 Před 9 měsíci

    Nice Video, Can anybody suggest the best flow for Desktop Application, based on this video i feel it is implicit flow but saving credentials in desktop application that is deployed on client machine doesn't feel to be secure.

  • @yapayzeka
    @yapayzeka Před 10 měsíci

    31:42 I think these poor souls are SPAs with only static files. like no backend operation.

  • @semen083
    @semen083 Před rokem +2

    Nice -haircut- video.
    1)What the point of exchage of authcode to code? Why don't instantly return token like in implicit flow? What secure advantages it provides?
    2)Client Secret it the thing, what user input in password textbox or it is single secret for client aplication(like javascript client)?
    3)What the secure place for storing acses token in Vue js application?Vuex?
    4)What the good auth flow for service-to-service communication, like between microservices?
    Thanks

    • @RawCoding
      @RawCoding  Před rokem +1

      1) the token will reach the browser in the query, which can further get logged and it’s a mess.
      2) when you create a record of your app with the authorisation server it will give you a client secret to add to your app.
      3) a dedicated backend or encrypted cookie.
      4) client credentials, if it’s your services use firewall rules.

  • @anonymousvevo8697
    @anonymousvevo8697 Před 3 měsíci

    i like the picture at the end of the wall, plus dude too many ads! come on it's exaggerating !

  • @TheAzerue
    @TheAzerue Před rokem +1

    Hi
    One question during video you mentioned that RPOC can be used if client + authorization server + resource server are one application. Please note by single application i don't necessarily mean are built in same technology say AspNetCore or Java. Fronend could be angular, react and backend could be dotnet. But all entites are under same company or team and can be trusted. But later in video you mentioned that RPOC is deprecated.
    So can we use RPOC if all three entities can be trusted or it should be avoided.
    Great video.
    Cheers

    • @RawCoding
      @RawCoding  Před rokem

      It can be used but it’s not part of the protocol. From OAuth 2.1 perspective there is no RPOC. From your perspective you’re getting a token by posting credentials to your server. Do remember it’s for authorisation if you are authenticated and you have to post credentials one more time it’s gonna feel a little weird.

    • @TheAzerue
      @TheAzerue Před rokem

      @@RawCoding Yes i understand. To authenticate again if token expires, i have used refresh token that has longer expiration

  • @dune102
    @dune102 Před rokem +3

    Great content, very detailed as I wasn't aware of the 2.1 changes.
    How does Authentication fit in with OAuth?
    Can software use OAuth like this safely for controlling access to applications/apis without first authenticating a user / user request?
    Is this where OpenId Connect comes in to sit on top / to be used in conjunction with OAuth to provide the authentication part of the puzzle?
    I guess I'm wondering how we can Authorise a request without first knowing who is making the request i.e. without the authentication part?
    edit: I'm currently thinking that we can use OAuth when we want the authorisation part irrespective of any particular user, and need authentication first when we want to allow different claims/roles/permissions depending upon a specific user.......I maybe wrong though \o/

    • @RawCoding
      @RawCoding  Před rokem +1

      Yep OpenIdConnect solves the authentication issue. Ofc you can implement so that the token would authn the user but it’s frowned upon.

    • @adamc1694
      @adamc1694 Před rokem

      Things are getting really complicated these days. In the old days a company had to create and manage each user's login and password. Nowadays they can utilize a third party like Google, Facebook, MSN... to do the authentication. And then if they purchase third party software/service, a company can register the third party's endpoint URL to implement the authorization (OAuth).
      Azure has it all covered though. Pretty much just some configurations.

  • @gregorywilson2124
    @gregorywilson2124 Před rokem +1

    What if you are doing oAuth 2 with a WPF client? Does WPF client has to do all the things that are built into the browser?

    • @RawCoding
      @RawCoding  Před rokem +2

      WPF would have to open a browser to obtain the token. You see this when you authenticate with Visual Studio as well.

  • @oleksandrdidenko1872
    @oleksandrdidenko1872 Před rokem +13

    russians can travel only to belorussia. That was the most amazing moment in the video!!!

    • @LouisWaweru
      @LouisWaweru Před rokem

      I thought it was well done. Didn't realize others commented on it already. I should say that I enjoyed it for pointing out Western hypocrisy. I’m starting to understand people may enjoy it for different reasons though.

    • @shananboiara
      @shananboiara Před rokem

      Ну вообще в Казахстан еще, но подъ*б засчитан)

  • @ahmedifhaam7266
    @ahmedifhaam7266 Před rokem +1

    I'd love to know how to see this flow happen slowly in debugger, espeically since this back channel stuff can't be seen on browser

    • @RawCoding
      @RawCoding  Před rokem

      have you seen the playlist? checkout the building your own oAuth server

    • @ahmedifhaam7266
      @ahmedifhaam7266 Před rokem

      @@RawCoding Oh, I just saw it, thanks! Hope you know, we really, really, appreciate what you're doing.. truly, Thank you.

  • @omfgiwantausername21
    @omfgiwantausername21 Před rokem +1

    What does "opt" in the diagram mean in this context? Options?

    • @RawCoding
      @RawCoding  Před rokem +2

      Nothing, the modelling tool came with it I couldn’t remove it

    • @omfgiwantausername21
      @omfgiwantausername21 Před rokem +1

      @@RawCoding lol - here I was, all excited to learn a new term 🤣

    • @RawCoding
      @RawCoding  Před rokem +1

      😂

  • @erikknudsen5856
    @erikknudsen5856 Před rokem +2

    Resource Owner Password Credential should be ROPC, not RPOC...?

  • @shivamkumargaur9871
    @shivamkumargaur9871 Před rokem +1

    I procrastinated for 6 years

  • @KunalMukherjee3701
    @KunalMukherjee3701 Před rokem +1

    Now make a video on Azure ad b2c authenticating and authorizing a .net6 api

  • @ahmedifhaam7266
    @ahmedifhaam7266 Před rokem +1

    I still don't really understand what the 'code' is, you said a collection of strings, ok, but what is it.

    • @RawCoding
      @RawCoding  Před rokem +1

      It’s a random string, it’s purpose is to be exchanged for a token. The reason we give out a code instead of the token directly is because code is passed via browser url which is public and we want to keep the token secret. code is a 1 time use and is exchanged for the token via back channel.

    • @ahmedifhaam7266
      @ahmedifhaam7266 Před rokem +2

      @@RawCoding gotchaa, thank you so much. yeaah so I work for the govenment, they are doing this unified identity system and wants to integrate that to all gov sites for citizens to login.
      I saw one string called just code, and something called a x_login_code, so was trynna understand the difference. In any case, tysm, you helped me get my middle level developer job in the gov without a degree hehe.

    • @RawCoding
      @RawCoding  Před rokem +1

      Absolute boss well done!

  • @saurabhchauhan232
    @saurabhchauhan232 Před rokem

    Can you Please make one video on salting and hasing password to store in db?

  • @CyanideM0nkey
    @CyanideM0nkey Před 4 měsíci

    Fine, you can have a like for the Khabib reference 😜

  • @oleggavrilov7083
    @oleggavrilov7083 Před 9 měsíci

    18:57 If you in Russia, with international passport and some visas you can travel anywhere, and you don't even need a passport to travel to Ukraine for a nice vacation there.

  • @meJevin
    @meJevin Před rokem +1

    антон... волосы куда...

    • @RawCoding
      @RawCoding  Před rokem +3

      Надоели )

    • @pavelakimov1713
      @pavelakimov1713 Před rokem +2

      @@RawCoding смотрю все выпуски уже пару лет и ни разу не возникло мысли, что этот парень может говорить по-русски 😮Спасибо за видео, контент и подача как всегда на высоте!

    • @RawCoding
      @RawCoding  Před rokem

      Спасибо 😉

    • @semen083
      @semen083 Před rokem +2

      @@pavelakimov1713 я спалил его, когда он в одном из видосов в качестве экземпляров класса рассматривал машины и назвал одну из них "Лада".

    • @pavelakimov1713
      @pavelakimov1713 Před rokem

      @@semen083 точно точно, было такое! 😂😂😂

  • @rezarezash
    @rezarezash Před rokem +1

    Thanks for the video and content. I am trying to make a fetch request to the API endpoint and then set the response location header to the google auth server but I get the Cors Error.
    Access to fetch at 'accounts.google.com/o/oauth2/v2/auth/oauthchooseaccount?response_type=code&client_id=&redirect_uri=localhost:5279/weatherforecast&scope=openid%20profile%20email&state=CfDJ8IJqa1zOV1dOvnKTY_TMWjX1NvVUBThwVVYECnjxe4diq7xwtCmzJROXuQWLGhCMr2cSUpjVecB4Pl8LYpsF4wHZ0fu_ehXsJf9NDnDelzlN8YsEqKjUL_fVI02c-rHBD4FxM743ByQfH8uttr7kA-gbFybFfxctgjz7W_0PCVIRz9AFMUu_AQccsP1m2c0snJogwpJZcedeFKpVZjgWEfAhJethY-ouIEJZiKCF9BkZs5WeRKMjlFLVefW5RGCVk6fAgCL3BKLOWT-Qsfcjk3JU9XoFztWhI2u6XDzQL2dD&service=lso&o2v=2&flowName=GeneralOAuthFlow' (redirected from 'localhost:5279/LoginToGoogle') from origin 'localhost:5279' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

    • @RawCoding
      @RawCoding  Před rokem

      how are you redirecting?
      you want to do window.location.href = redirect_uri