OAuth Authorization code flow

Поделиться
HTML-код
  • Опубликовано: 4 дек 2024

Комментарии • 92

  • @jgoebel
    @jgoebel  3 года назад +8

    What do you think about this?
    Please let me know in the comments below.

    • @nicktacora
      @nicktacora 2 года назад

      amazing bro!

    • @jgoebel
      @jgoebel  2 года назад

      @@nicktacora thx

    • @OgnyanDimitrov
      @OgnyanDimitrov 2 года назад

      The explanation is clear. Thank you!

    • @backendbuddy
      @backendbuddy Год назад

      Bro very nice explanation in detail. Keep it up

    • @nauticaorangewatchbg9923
      @nauticaorangewatchbg9923 6 дней назад

      Thank you for this explanation, it is exactly what i needed to understand this flow better, although i need to implement this via Azure app registration, the philosophy is the same

  • @prakashsundra6667
    @prakashsundra6667 3 года назад +11

    The details were superb.. you clearly explained the flow. Great job ProductionCoder!

  • @umairyetoo9545
    @umairyetoo9545 Год назад +3

    Man, I am a backend dev with 4 yrs of exp. but believe me man I always get lost in this Oauth Grants. I always need to re do all R&D again. But here you explained very well mate, I must say perfectly explained. Kepp it up

    • @jgoebel
      @jgoebel  Год назад

      thx Umair, I'm glad it helped

  • @shanerigsby9030
    @shanerigsby9030 Год назад +1

    Your approach to explaining this is excellent. Thank you!

    • @jgoebel
      @jgoebel  Год назад

      Glad you enjoyed it!

  • @chrislaneyphotography
    @chrislaneyphotography 2 года назад +1

    Greatly appreciate this. Explanation of this flow brought it home for me on understanding

  • @vineetchaurasia7460
    @vineetchaurasia7460 Год назад

    One of the greatest content on oauth i ever found on RUclips,
    Thanks bud, for this wonderful content

    • @jgoebel
      @jgoebel  Год назад +1

      thx, I'm glad you found it useful

  • @supa1009
    @supa1009 Год назад

    best explanation on youtube, thank you!

    • @jgoebel
      @jgoebel  Год назад

      Glad it was helpful!

  • @MAxAMILLIoN757
    @MAxAMILLIoN757 2 года назад +7

    Can you share a read-only link to that drawio doc? Would be very helpful.

    • @shubhamrokz12
      @shubhamrokz12 2 года назад +1

      Agree, this would be very helpful.

  • @madrag
    @madrag Год назад

    Finally explanation I was looking for, thanks!

  • @andrebittencourt5512
    @andrebittencourt5512 3 года назад +1

    This video was incredible!! Thank you for share so much knowledge!

    • @jgoebel
      @jgoebel  3 года назад

      thx André, I'm glad you found it useful 👍

  • @alastairtheduke
    @alastairtheduke 9 месяцев назад +1

    Great explanation

    • @jgoebel
      @jgoebel  9 месяцев назад

      Glad you liked it

  • @m.k.bearit
    @m.k.bearit 4 месяца назад

    thanks! well prepared and informative, made my life much easier :)

    • @jgoebel
      @jgoebel  4 месяца назад

      You're welcome!

  • @911Neunelfer
    @911Neunelfer 3 года назад +1

    Very understandable, thanks for your efforts!

    • @jgoebel
      @jgoebel  3 года назад

      you're welcome Konstantin 👍

  • @drizztyang9502
    @drizztyang9502 Год назад

    Explained so clear!!!

  • @boomboom-9451
    @boomboom-9451 Год назад

    Great video, thanks for explaining that way!

  • @VitalikAwesome
    @VitalikAwesome 3 года назад

    I came here to put like! Everything clear I have no questions Thanks for video

    • @jgoebel
      @jgoebel  3 года назад

      Thx Віталік, I'm glad it helped!

  • @mohamed__gp5xz
    @mohamed__gp5xz Год назад

    Thanks for this great content.

  • @Moath268
    @Moath268 2 месяца назад

    very helpful thanks

  • @feysalmama1800
    @feysalmama1800 2 года назад

    Amazing explanation!. Thank you for your effort.

    • @jgoebel
      @jgoebel  2 года назад

      Glad you liked it

  • @brunogiovagnoli3022
    @brunogiovagnoli3022 2 года назад

    Amazing explanation.

    • @jgoebel
      @jgoebel  2 года назад

      Glad you liked it

  • @rodinCodin
    @rodinCodin Год назад

    awesome explanation, thank you, you've got another subscriber!

    • @jgoebel
      @jgoebel  Год назад

      great, thx Yegor

  • @entropy1088
    @entropy1088 Год назад +1

    Hey, I really love this video especially because it show visually whats going on instead of just tossing jargon around. What wasnt entirely clear though is WHY the code / token exchange is happening. Like, I dont understand how that extra steps adds additional security compared to the implicit flow for example. Any chance you could give me a hint here?

  • @satwikmanitiwari6020
    @satwikmanitiwari6020 3 года назад

    very nicely explained. great work !!

  • @mdamirhossain9376
    @mdamirhossain9376 2 года назад

    So far, its seems excellent tutorial to me. I bet, these video should have more like and subs...

    • @jgoebel
      @jgoebel  2 года назад +1

      Glad it was helpful!

  • @Uzair_Anwar2299
    @Uzair_Anwar2299 2 года назад

    amazing explaination

  • @kirstinebrrup9656
    @kirstinebrrup9656 6 месяцев назад

    Great video.

  • @JedGrant
    @JedGrant Год назад

    Great video. Would love to watch a follow up with a react app creating or updating a Google Doc.

  • @thereseparish3541
    @thereseparish3541 3 года назад +1

    This was an awesome explanation of grant type authorization code flow. Thank you so much! One question I have is how does this flow work when you have one API that needs authorization to access another API where there is no "user" login involved? For example, I have a Spring REST web service that a vendor cloud app (Dell Boomi app) needs to access. In the past, I've used password grant type, which I know is not best practice. Sorry if this is a basic question.... I'm new to auth code grant type flow.

    • @jgoebel
      @jgoebel  3 года назад

      Hi Therese, the authorization code grant is only used with a user together (someone clicks approve on a screen). For server to server communication OAuth2 offers the client credentials flow.
      Ultimately it is a judgement call. Basic Auth is way simpler to implement because it is just username / password. With OAuth you need an authorization server. So unless you don't already support OAuth, I would rather go with Basic Auth. You might also want to take a look at using JWTs for server to server communication (I have a video series about this). This is probably better in terms of security, but more work to implement. You need to decide if it would be worth doing.

  • @muzamilshaikh838
    @muzamilshaikh838 Год назад

    our approach to explaining this is excellent❤ and plzz can you give me your explaination sheet

  • @muralikumara9881
    @muralikumara9881 Год назад +1

    The details are well explained , thank you. Would be helpful if you share the diagram which is referenced in this tutorial.

  • @ayg087
    @ayg087 Месяц назад

    Thanks for your effort, it’s a great explanation! Just got a question regarding OAuth2.0 Authorization code, is it a good practice to use this method with Cisco ISE & Azure AD integration for endusers authentication?

  • @azgharkhan4498
    @azgharkhan4498 Год назад +2

    The auth code flow explanation was really great. However the part where you explained about client secret is not very clear. perhaps little more detailed explanation would have helped me

    • @jgoebel
      @jgoebel  Год назад +2

      Think of client id as a username and client secret as a password. OAuth 2.0 also supports stronger means of authentication against the token endpoint such as mTLS or JWT assertions

    • @marcus-vg8ft
      @marcus-vg8ft 10 месяцев назад

      @@jgoebel Absolutely awesome series of videos!! Thank you Jan! -- One question regarding this: Why is important to keep the client_secret as a pw? After all, even if an attacker gets it, it will still need the user to authenticate.

    • @jgoebel
      @jgoebel  10 месяцев назад +1

      @@marcus-vg8ft if you have the client secret, then you can impersonate an app. I.e. an attacker could pretend that he is the app for which he has obtained the client secret and get access to the user's data

    • @marcus-vg8ft
      @marcus-vg8ft 10 месяцев назад

      Thanks Jan! If it is for what Google calls "A desktop app" where the user will store the secret on his own computer, is this still risky? I thought with PKCE it should be safe no matter what.
      @@jgoebel

    • @jgoebel
      @jgoebel  10 месяцев назад

      @@marcus-vg8ft an attacker could impersonate the app and get access to the user's data on the resource server

  • @СергейЛистов-б4е
    @СергейЛистов-б4е 2 года назад

    Good work, thanx a lot!

    • @jgoebel
      @jgoebel  2 года назад

      You are welcome!

  • @jeno101
    @jeno101 Год назад

    We get "redirect uri " two times within your UC diagram .. which is the one actually registered with the server initially ?

  • @kemalgenc7117
    @kemalgenc7117 Год назад

    Thank you for a detailed explanation. My question is how the resource server validates the access token? We need a call from resource server to auth server in order to validate right? Do we have a standart for this communication?

    • @jgoebel
      @jgoebel  Год назад +1

      I explained it here: ruclips.net/video/q3FiuTZlroE/видео.htmlsi=Vp_lWURCU0-HbG2Q&t=404
      Either via a call to the authorization server or - if the token is structured (e.g. a JWT), then by validating the token's signature with a public key

  • @HappyTest-rr3jq
    @HappyTest-rr3jq 7 месяцев назад

    hey i get that oauth2 is required by third party to access api, example when i say continue with google for the first time it will get my email name profile photo and all, this will help in getting those data and creating user but how login happens with "login with google" button.

  • @baustin612
    @baustin612 Год назад

    is the diagram shown in the video available anywhere?

  • @KavinChakaravarthi
    @KavinChakaravarthi 2 года назад

    what should be the redirect_url be like. how it was determined ? can you give me the example

  • @SentinelMoonlight
    @SentinelMoonlight 2 года назад

    All clear)thanks)!

    • @jgoebel
      @jgoebel  2 года назад

      Glad it helped!

  • @nglara
    @nglara 2 года назад

    Please help. Is there a sample angular application that implements this? I need to learn it. Thanks!

  • @DMoots
    @DMoots Год назад

    Thanks for the video this has been very helpful for me.
    I've one question I hope you can answer for me.
    Once I've passed authentication and have received the token back on the client, and then the client makes a request to the RESOURCE server. Does the resource server need to check the token against the auth server with every request?

    • @jgoebel
      @jgoebel  Год назад +1

      Most servies use structured tokens, i.e. JWTs, so you can validate the token without making a REST call to the authorization server. There are a few edge cases you could run into however, .e.g if a token is revoked you might accept it on your service.
      Therefore, for critical actions like purchasing sth. you can use token introspection endpoint of the authorization server where you can have a token validated

    • @DMoots
      @DMoots Год назад

      @@jgoebel thanks for the explanation 👍

  • @divyeshkumarbalar7732
    @divyeshkumarbalar7732 10 месяцев назад

    did you said, authorization code flow clients does not need a secret? Dont we need the secret to exchange the code for access token?

    • @divyeshkumarbalar7732
      @divyeshkumarbalar7732 10 месяцев назад

      sorry commented too early before watching the whole video

  • @siwarhadjali354
    @siwarhadjali354 2 года назад

    thannk youu

    • @jgoebel
      @jgoebel  2 года назад

      You're welcome!

  • @pradyun679
    @pradyun679 Год назад +1

    Can you please share the drawing? It would be really helpful.

  • @ralphanthonyplanteras6246
    @ralphanthonyplanteras6246 Год назад

    how can you get the code from the authorization? automatically, noy by copying it from the browser?

    • @jgoebel
      @jgoebel  10 месяцев назад

      you can access the browser's URL and get the code from the query parameters

  • @ThoDaGeEtKuDunGi
    @ThoDaGeEtKuDunGi 2 года назад

    how do i take code and state parameter to the backend in python

    • @jgoebel
      @jgoebel  2 года назад

      you would make a REST call to your backend

  • @anushkashrivastava9035
    @anushkashrivastava9035 Год назад

    I love fight club too XD

  • @memester3199
    @memester3199 2 года назад

    It has given me an authorization code, but where do I paste the code in?

    • @jgoebel
      @jgoebel  2 года назад

      the authoriztion code is sent to the token endpoint of the authorization server to obtain an access and / or refresh token.

  • @PraveenKumar-u8c2c
    @PraveenKumar-u8c2c 8 месяцев назад

    wow...

  • @critical5555
    @critical5555 Год назад

    So server side rendered apps don't use a state parameter because using a client secret makes it secure enough already?
    Also, if anyone has any resources explained how to decide what the redirect URL should be, please link (I am new to this and I suspect it may be obvious to many)

  • @chechochimes
    @chechochimes 2 года назад

    Thanks for this! Right now I need implement an app that create some google-calendar events but for a ServiceAccount. I saw many examples in docs that creates/uses AuthorizationCodeInstalledApp (or similar) to create a 'credential' instance (com.google.api.client.auth.oauth2.Credential) but it works for regular user accounts and not for ServiceAccount (I already have the JSON file with key info from my ServiceAccount) . Do you know where I can find some examples for what i'm looking for? Something like this:
    final NetHttpTransport HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport();
    JsonFactory jsonFactory = GsonFactory.getDefaultInstance();
    GoogleCredentials credential = GoogleCredentials.fromStream(new FileInputStream(jsonPath))
    .createScoped(Collections.singleton(CalendarScopes.CALENDAR));
    Calendar calendar = new Calendar.Builder(HTTP_TRANSPORT, jsonFactory, credential)
    .setApplicationName(APPLICATION_NAME)
    .build();
    (this example isn't working because Calendar.Builder needs some Credential obj as a third param)