Jan Goebel
Jan Goebel
  • 153
  • 1 247 659
OAuth 2.0 - a dead simple explanation
X: _jgoebel
Website: jangoebel.com
00:00 What is OAuth 2.0?
00:13 What problem does OAuth 2.0 solve?
02:04 OAuth 2.0 Client Registration
03:06 OAuth 2.0 Confidential vs. public clients
04:21 OAuth 2.0 Authorization Code Grant
06:43 OAuth 2.0 Access and Refresh Tokens and JWTs
08:03 OAuth 2.0 Grant types: client credentials grant, implicit grant, resource owner password grant, device grant
09:03 Outro
OAuth 2.0 is an "authorization framework [that] allows third party applications to get limited access to an HTTP service" (RFC 6749).
OAuth 2.0 is all about giving third party applications limited access to APIs. Prior to OAuth 2.0, the third party would have asked for the user's credentials and would have used these credentials on the respective API. OAuth 2.0 eliminates the need for password sharing by introducing a new entity called the OAuth 2.0 authorization server.
The OAuth 2.0 authorization server issues access and refresh tokens to third party applications thereby eliminating the need of credential sharing. The third party application is called the client in OAuth terminology. The API the third party wants to get access to is called the resource server or the protected resource.
Before a third party can get limited access to an API, it first needs to register itself with the OAuth 2.0 Authorization server. The third party application, the so called client, gets a client id upon registration with the OAuth 2.0 authorization server. If the client can keep data secret, then it will also obtain client credentials. The simplest form of a client credential would be a shared secret called the client secret. OAuth 2.0 also supports more sophisticated means auf authenticating against the OAuth 2.0 authorization server such as mutual TLS (mTLS).
Once the client is registered, the client performs one of the OAuth flows that are also known as grant types. The most popular grant types are the OAuth 2.0 authorization code grant which orchestrates an approval flow between the resource owner, the OAuth 2.0 authorization server and the protected resource.
Contrast this with the client credentials grant which is made for machine-to-machine communication. The resource owner password grant and the implicit grant are insecure according to the OAuth 2.0 Security best current practices and must not be used. Then there is also the OAuth 2.0 device grant which is built for devices that do not have a browser or where entering credentials is cumbersome such as Smart TVs.
While the OAuth 2.0 RFC does not mandate the access and refresh tokens to be structured, in most deployments they are actually JSON Web Tokens (JWTs). This has the advantage that the protected resource can validate the signature of the token locally without having to make a REST call to the authorization server to check for the validity of the token.
Picasso Artwork: www.freepik.com/free-vector/hand-drawn-picasso-style-illustration_29679617.htm Image by Freepick
Artist: www.freepik.com/free-vector/artist-art-tools-set_3813261.htm Image by macrovector on Freepick
Software Engineer: www.freepik.com/free-vector/binary-code-concept-illustration_15581993.htm Image by storyset on Freepick
มุมมอง: 16 878

วีดีโอ

What is the difference between a PUT and a PATCH request?
มุมมอง 9Kปีที่แล้ว
🔥More exclusive content: productioncoder.com/you-decide-what-we-build-next Twitter: _jgoebel Website: jangoebel.com Blog: productioncoder.com PATCH RFC: datatracker.ietf.org/doc/html/rfc5789#section-9.1 The PUT HTTP verb is used to create or replace the resource under a specific URI completely. In case the resource under a particular URI already exists, it will be completely overwri...
What is a hash function?
มุมมอง 2.3Kปีที่แล้ว
🔥More exclusive content: productioncoder.com/you-decide-what-we-build-next Twitter: _jgoebel Website: jangoebel.com Blog: productioncoder.com A hash function is a function on a bit string that produces an output of fixed length. The goal of hash functions is to avoid collisions as much as possible. Typically the moment a collision is found in a modern hash function, this particular ...
What is the difference between data authenticity and data integrity?
มุมมอง 1.3Kปีที่แล้ว
🔥More exclusive content: productioncoder.com/you-decide-what-we-build-next Twitter: _jgoebel Website: jangoebel.com Blog: productioncoder.com Data Authenticity is the property that data comes from its purported source. Data Authenticity is violated if a message is not coming from the person you expect it to come from. Data Integrity is the property that data has not been altered or ...
What's the difference between Authentication vs Authorization?
มุมมอง 3.4K2 ปีที่แล้ว
🔥More exclusive content: productioncoder.com/you-decide-what-we-build-next Twitter: _jgoebel Website: jangoebel.com Blog: productioncoder.com Authentication is the process of verifying the identity of a user, process or device, often as a prerequisite to allowing access to resources in an information system. If you are trying to enter a country, the border officer is essentially per...
What is the difference between URI, URL and URN?
มุมมอง 5K2 ปีที่แล้ว
🔥More exclusive content: productioncoder.com/you-decide-what-we-build-next Twitter: _jgoebel Website: jangoebel.com Blog: productioncoder.com URN RFC: datatracker.ietf.org/doc/html/rfc8141 URI RFC: datatracker.ietf.org/doc/html/rfc3986 00:00 What is a URI? 00:39 What is a URL? 01:13 What is a URN? URI stands for Uniform Resource Identifier and is an identifier for a physical or abst...
OAuth 2.0 Pushed Authorization Requests
มุมมอง 3.4K2 ปีที่แล้ว
🔥More exclusive content: productioncoder.com/you-decide-what-we-build-next Twitter: _jgoebel Website: jangoebel.com Blog: productioncoder.com PAR RFC: www.rfc-editor.org/rfc/rfc9126.html When authorizing a natural person with the authorization code grant in OAuth 2.0, the initial request parameters are sent via the browser's bar (front channel). This poses several challenges 1. no a...
OAuth2 Resource Indicators
มุมมอง 1.4K2 ปีที่แล้ว
🔥More exclusive content: productioncoder.com/you-decide-what-we-build-next Twitter: _jgoebel Website: jangoebel.com Blog: productioncoder.com Resource Indicators RFC: datatracker.ietf.org/doc/html/rfc8707 00:00 What are OAuth2 resource indicators and why are they useful? 01:50 OAuth 2.0 Resource Indicators with JWTs 04:07 Conclusion Resource Indicators are a way for an OAuth2 client...
OpenID Connect client authentication: client_secret_jwt and private_key_jwt
มุมมอง 4.5K2 ปีที่แล้ว
🔥More exclusive content: productioncoder.com/you-decide-what-we-build-next Twitter: _jgoebel Website: jangoebel.com Blog: productioncoder.com OpenID core spec: openid.net/specs/openid-connect-core-1_0.html#ClientAuthentication 00:00 client authentication for confidential clients in OAuth 2 and OpenID Connect 01:10 OpenID Connect client_secret_jwt client authentication 03:53 OpenID C...
OpenID Connect client authentication: basic auth and client secret post
มุมมอง 2.6K2 ปีที่แล้ว
🔥More exclusive content: productioncoder.com/you-decide-what-we-build-next Twitter: _jgoebel Website: jangoebel.com Blog: productioncoder.com Link to OAuth 2.0 Core RFC: datatracker.ietf.org/doc/html/rfc6749#section-2.3 00:00 Client Authentication in OAuth and OpenID Connect 00:28 Using HTTP Basic Auth (client_secret_basic) to authenticate to the authorization server 01:01 client_se...
OAuth 2.0 mutual client authentication (mTLS)
มุมมอง 9K2 ปีที่แล้ว
🔥More exclusive content: productioncoder.com/you-decide-what-we-build-next Twitter: _jgoebel Website: jangoebel.com Blog: productioncoder.com OAuth mTLS RFC: tools.ietf.org/html/rfc8705 00:00 Client Authentication between client and OAuth authorization server 01:41 OAuth 2.0 mutual TLS (mTLS) 04:43 OAuth 2.0 Certificate-Bound Access tokens with mutual TLS 05:59 Binding an access tok...
OAuth 2.0 JWT-secured Authorization Requests (JARs)
มุมมอง 3.4K2 ปีที่แล้ว
🔥More exclusive content: productioncoder.com/you-decide-what-we-build-next Twitter: _jgoebel Website: jangoebel.com Blog: productioncoder.com JWT-secured authorization requests RFC: datatracker.ietf.org/doc/html/rfc9101 00:00 Introduction to authorization requests in OAuth 01:37 What are JWT-secured authorization requests? 02:32 Using JWEs to encrypt authorization requests 04:24 JWT...
What are Bearer Tokens?
มุมมอง 23K2 ปีที่แล้ว
🔥More exclusive content: productioncoder.com/you-decide-what-we-build-next Twitter: _jgoebel Website: jangoebel.com Blog: productioncoder.com OAuth 2 Bearer Token Usage: datatracker.ietf.org/doc/html/rfc6750 00:00 What are Bearer tokens? 01:43 Proof of Possession would increase security Bearer tokens are commonly used for authorization and authentication on the web. If a token is a ...
OAuth 2.0 Dynamic Client Registration Management
มุมมอง 1.8K2 ปีที่แล้ว
🔥More exclusive content: productioncoder.com/you-decide-what-we-build-next Twitter: _jgoebel Website: jangoebel.com Blog: productioncoder.com OAuth Dynamic Client Registration Management Protocol: datatracker.ietf.org/doc/html/rfc7592 00:00 What is OAuth Dynamic Client Registration Management? 01:01 OAuth Client Configuration Endpoint and registration access token 01:40 Reading, upd...
OAuth 2 Dynamic Client Registration
มุมมอง 5K2 ปีที่แล้ว
OAuth 2 Dynamic Client Registration
OAuth Authorization Server Metadata
มุมมอง 5012 ปีที่แล้ว
OAuth Authorization Server Metadata
Well-known URIs
มุมมอง 1.1K2 ปีที่แล้ว
Well-known URIs
OAuth 2 Token Introspection
มุมมอง 7K2 ปีที่แล้ว
OAuth 2 Token Introspection
OAuth 2.0 Token Revocation
มุมมอง 4.8K2 ปีที่แล้ว
OAuth 2.0 Token Revocation
Unsecured JWTs are a huge security vulnerability
มุมมอง 1.2K2 ปีที่แล้ว
Unsecured JWTs are a huge security vulnerability
HMAC vs digital signature
มุมมอง 4.4K2 ปีที่แล้ว
HMAC vs digital signature
HTTP Message Signatures explained
มุมมอง 3.3K2 ปีที่แล้ว
HTTP Message Signatures explained
HTTP structured field values: standardizing HTTP headers and trailers
มุมมอง 5312 ปีที่แล้ว
HTTP structured field values: standardizing HTTP headers and trailers
OpenID Connect vs OAuth | OpenID Connect explained
มุมมอง 37K2 ปีที่แล้ว
OpenID Connect vs OAuth | OpenID Connect explained
OAuth vs JWTs
มุมมอง 2.1K2 ปีที่แล้ว
OAuth vs JWTs
JWS vs JWE
มุมมอง 10K2 ปีที่แล้ว
JWS vs JWE
Should you use HS256 with JWTs?
มุมมอง 7072 ปีที่แล้ว
Should you use HS256 with JWTs?
HS256 vs RS256 with JSON Web Tokens (JWTs)
มุมมอง 2.7K2 ปีที่แล้ว
HS256 vs RS256 with JSON Web Tokens (JWTs)
JWT RS256
มุมมอง 5K2 ปีที่แล้ว
JWT RS256
JWT HS256
มุมมอง 1.7K2 ปีที่แล้ว
JWT HS256

ความคิดเห็น

  • @technicalboy1816
    @technicalboy1816 6 วันที่ผ่านมา

    JS doesn't belong on the backend mate!

  • @NirdeshPokhrel
    @NirdeshPokhrel 6 วันที่ผ่านมา

    Thank you. ❤

    • @jgoebel
      @jgoebel วันที่ผ่านมา

      You're most welcome

  • @danielalfredorayoroldan3075
    @danielalfredorayoroldan3075 6 วันที่ผ่านมา

    EXPLAINED WOUNDERFULLY! THANKS A LOT!

    • @jgoebel
      @jgoebel วันที่ผ่านมา

      Glad you liked it!

  • @sigge.g2193
    @sigge.g2193 8 วันที่ผ่านมา

    thanks!

    • @jgoebel
      @jgoebel วันที่ผ่านมา

      Welcome!

  • @lolloBriggi
    @lolloBriggi 9 วันที่ผ่านมา

    Why do we moved to this kind of big tech thrid party fucking payed login system? Just keep your user in your database and every time one user log-in it ask for a token (that has an expiration time) than can now be use by the frontend to fetch the fuck it need. All those layer of fake security introduce only more complexity and more layer of possible failure or human error. Keep in mind that we are not running bank (and not even bank use those fucking systems)but 99% of us are running fucking website and note apps. and dont use the fucking PaaS or cloud or fucking shit overpriced that the industry convince coding monkey to use, just use a fucking VPS and if you need use also a CDN. Fuck this programming industry and fucking garbage language and framework like react ecosystem. Just program dont spent your time learning fucking slave instrument and mental masturbation system deseigned as gucci clothing to create a urge of need and run tech buisneeses with the money you give them and train fucking AI with the data you give them. I hate programmers so dumb and they feels so smart with their ununderstandable documentation and their fear to re-write the weel. Frankly said you are a waste of oxygen and mass producer of carbon-dioxide to maintain fucking inefficient and useless systems not to mention that 50% of all apps probably don’t even need to use https over http, wtf an hacker will do with the agar.io information of one user? Ridiculous

  • @user-rp6vo7ns5j
    @user-rp6vo7ns5j 11 วันที่ผ่านมา

    Excellent explanation, thank you!

    • @jgoebel
      @jgoebel วันที่ผ่านมา

      Glad you enjoyed it!

  • @IHHI22
    @IHHI22 21 วันที่ผ่านมา

    on my wordpress website -chrome on my phone says not secure, safari on laptop also says not secure but my SSL certificate is good i checked. also chrome on my laptop doesn't say not secure. I went to inspect >console on website and this error was there but I don't know what it means or where the error is located. The Source Location is blank - "Content Security Policy of your site blocks the use of 'eval' in JavaScript` The Content Security Policy (CSP) prevents the evaluation of arbitrary strings as JavaScript to make it more difficult for an attacker to inject unathorized code on your site. To solve this issue, avoid using eval(), new Function(), setTimeout([string], ...) and setInterval([string], ...) for evaluating strings. If you absolutely must: you can enable string evaluation by adding unsafe-eval as an allowed source in a script-src directive. ⚠ Allowing string evaluation comes at the risk of inline script injection. 1 directive Source location Directive Status script-src blocked

  • @ecommercetechbuild1354
    @ecommercetechbuild1354 22 วันที่ผ่านมา

    Wonderful explanation

    • @jgoebel
      @jgoebel วันที่ผ่านมา

      Glad it was helpful!

  • @toufikurrahmantoufik5368
    @toufikurrahmantoufik5368 25 วันที่ผ่านมา

    Thank You so much . I have complete a task. by following for video.

    • @jgoebel
      @jgoebel วันที่ผ่านมา

      glad to hear!

  • @m.k.bearit
    @m.k.bearit 25 วันที่ผ่านมา

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

    • @jgoebel
      @jgoebel วันที่ผ่านมา

      You're welcome!

  • @nemisis282
    @nemisis282 27 วันที่ผ่านมา

    So if im understanding this correctly, this just prevents loading scripts, from sources not allowed by the CSP. But an attacker could still use an inline script tag to run any javascript they could fit everything they need within the comment box (assuming stored and in a comment input)?

  • @BB-bo4iy
    @BB-bo4iy หลายเดือนก่อน

    Thank you for explaining it in such detail. I looked for many videos for CORS explanation and yours might be one of the best ones.

  • @ukaszkiepas57
    @ukaszkiepas57 หลายเดือนก่อน

    thank you buddy ! :)

    • @jgoebel
      @jgoebel วันที่ผ่านมา

      You're most welcome!

  • @Mr.D4yz
    @Mr.D4yz หลายเดือนก่อน

    Great video! Short and simple explanation to share with colleagues and not look like an alien trying to explain it.

  • @YummyExtraSteps
    @YummyExtraSteps หลายเดือนก่อน

    My hero

  • @samuelopeyemi8377
    @samuelopeyemi8377 หลายเดือนก่อน

    Thank you. Is there a way to add text on a loaded image without first doing it with canvas? Adding text on the image directly with pdfkit

  • @nhefner
    @nhefner หลายเดือนก่อน

    fantastic explanation, thank you!!

  • @LewisMoten
    @LewisMoten หลายเดือนก่อน

    How is this different from hashing passwords with salt? hash('sha256', 'My Password'.$salt)

  • @sakthinivasan2678
    @sakthinivasan2678 หลายเดือนก่อน

    one of the best video,I have seen about oauth 2.0

  • @barani7821
    @barani7821 หลายเดือนก่อน

    Best explanation for PKCE, Thanks so much

  • @serdar.d
    @serdar.d หลายเดือนก่อน

    Thank you for the video, Jan.

  • @serdar.d
    @serdar.d หลายเดือนก่อน

    Just to answer the question in min 12: Yes, a JWE video would be great (if you haven't already done it)

  • @alexpato4
    @alexpato4 หลายเดือนก่อน

    One of the best explanations about OAuth, thanks a lot!

  • @drstrangebudgie4052
    @drstrangebudgie4052 หลายเดือนก่อน

    Great video. I would also mention that the structured token has an expiration date. So if a token is revoked at the auth server but the resource server doesn't introspect, at least the resource server will only accept the token until it expires anyway.

  • @zmxn007
    @zmxn007 หลายเดือนก่อน

    Short but a Beautiful explanation of PKCE with OAuth. Thanks

  • @kirstinebrrup9656
    @kirstinebrrup9656 2 หลายเดือนก่อน

    Great video.

  • @mattgraves3709
    @mattgraves3709 2 หลายเดือนก่อน

    Damn clients...just unable to keep things confidential

    • @jgoebel
      @jgoebel 2 หลายเดือนก่อน

      Indeed 😅

  • @aghiadalzein3069
    @aghiadalzein3069 2 หลายเดือนก่อน

    Great video ,simple and directly into the point thanks a lot.

    • @jgoebel
      @jgoebel 2 หลายเดือนก่อน

      Glad it was helpful!

  • @codezard1
    @codezard1 2 หลายเดือนก่อน

    I have a question, while redirecting at very first time to Athorization server, we pass code challenge and the method with which it is hashed, if anyone steals that information then it can easily decrypt the original Code verifier and next time it can steal the Authorization Code and send the same code verifier string.

    • @jgoebel
      @jgoebel 2 หลายเดือนก่อน

      The code verifier is a randomly generated, high-entropy string that is generated freshly for every OAuth authorization

  • @user-qt1mz2xe8c
    @user-qt1mz2xe8c 2 หลายเดือนก่อน

    Perfect video! Only thanks to that I`ve understood why is token introspection sometimes needed with jwt tokens. Thank you very much!

    • @jgoebel
      @jgoebel 2 หลายเดือนก่อน

      Glad it helped!

  • @softMediaWox
    @softMediaWox 2 หลายเดือนก่อน

    Saved my project. Thanks.

    • @jgoebel
      @jgoebel 2 หลายเดือนก่อน

      Glad it helped!

  • @grltrader
    @grltrader 2 หลายเดือนก่อน

    Great video!

    • @jgoebel
      @jgoebel 2 หลายเดือนก่อน

      Glad you enjoyed it

  • @alexpascal5403
    @alexpascal5403 2 หลายเดือนก่อน

    great explanation, it took a while to find one. You put it in a visual way and your explaination skills are like a teacher. ... you deserve a good old massaging of the balls.

  • @josephchris8629
    @josephchris8629 2 หลายเดือนก่อน

    I can not be grateful enough. This is my first comment ever on TH-cam. You are indeed a great Teacher!

    • @jgoebel
      @jgoebel 2 หลายเดือนก่อน

      thx

  • @HappyTest-rr3jq
    @HappyTest-rr3jq 3 หลายเดือนก่อน

    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.

  • @georgesmith9178
    @georgesmith9178 3 หลายเดือนก่อน

    Yes, I noticed times and again that whoever wrote the specification did not really go over them logically and make sure there was no overlap. The explanation here was good. The reality though is staggering as developers who never read the spec "REST-ful", or should I say REST-like code. Of course, I can't blame them - they are constantly assigned 2.5 their possible workload ALL the time. So who has time to read the spec!? The managers just wants them to close the tickets, so the report looks good.

    • @jgoebel
      @jgoebel 2 หลายเดือนก่อน

      True, but I found that if you know the theory and the spec, you can get things done way faster and have less stress in the long run

  • @feugos
    @feugos 3 หลายเดือนก่อน

    Hi! Is it possible concatenate some custom log in the end of main log for each route?

  • @andreaskaudel3047
    @andreaskaudel3047 3 หลายเดือนก่อน

    Great stuff ! Thank you very much !

    • @jgoebel
      @jgoebel 2 หลายเดือนก่อน

      Glad you liked it!

  • @ruocaled
    @ruocaled 3 หลายเดือนก่อน

    So you're saying it's just for displaying something immediately on the callback UI to reduce API calls? seems pretty pointless unless it's does something else.

    • @jgoebel
      @jgoebel 2 หลายเดือนก่อน

      It tells you who the end user is. OAuth only tells you what the end user can do

  • @tomatte99
    @tomatte99 3 หลายเดือนก่อน

    thankssss

    • @jgoebel
      @jgoebel 2 หลายเดือนก่อน

      you're welcome

  • @Voigt_Analytics
    @Voigt_Analytics 3 หลายเดือนก่อน

    Wenn ich doch nur wüsste, wie man diese blöden Konfigurationsprofile (p12) mit Zertifikat & Key für iOS/iPadOS erstellen könnte. Bei macOS klapppt der Import in die Keychain über das Terminal. Doch wie macht man das bei iOS, wenn man mTLS in Safari zum Login nutzen möchte? Jemand eine Idee? Hab schon verschiedene Ansätze ausprobiert, alle sind gescheitert. 😞

  • @najaericsson71
    @najaericsson71 3 หลายเดือนก่อน

    Very good!

    • @jgoebel
      @jgoebel 2 หลายเดือนก่อน

      Thanks!

  • @user-od7yh9xc9o
    @user-od7yh9xc9o 3 หลายเดือนก่อน

    So well explained , thank you so much and just keep goin'.

    • @jgoebel
      @jgoebel 2 หลายเดือนก่อน

      thx

  • @srinivas1483
    @srinivas1483 3 หลายเดือนก่อน

    Message digest algorithms don't use secret keys, where HMAC is a combination of a secret key and a hash function.

  • @Saurabh12129
    @Saurabh12129 3 หลายเดือนก่อน

    This makes me believe I am not dumb.

    • @jgoebel
      @jgoebel 2 หลายเดือนก่อน

      Most explanations on the Internet are just overly complicated and don't explain the why

  • @saravanasai2391
    @saravanasai2391 3 หลายเดือนก่อน

    Great explanation.

    • @jgoebel
      @jgoebel 3 หลายเดือนก่อน

      Glad you liked it

  • @pierspad
    @pierspad 3 หลายเดือนก่อน

    Good video but really bad EQ, I had to really crank down 125HZ cut to keep the floor from shaking :/

  • @jrblackify
    @jrblackify 3 หลายเดือนก่อน

    Excellent video! Not verbose and tedious like many others, and very informative. The only small nit I have: at 4:45 you say "we will learn about the response type in a minute" but then I don't think you ever talk about it. You do talk about Grant Types which are related (I think?) but not response type.

  • @nwaformicah433
    @nwaformicah433 3 หลายเดือนก่อน

    Nice video and I think of using Oauth for the project am working on now but I want to ask a question. Did I need to pay or add my credit card before I can use it?

    • @jgoebel
      @jgoebel 3 หลายเดือนก่อน

      OAuth is just a standardized framework and quite a few Identity Providers offer it as a service. Whether or not that is free depends on the provider

    • @nwaformicah433
      @nwaformicah433 3 หลายเดือนก่อน

      @@jgoebel Thanks so much I just want to use user email for sign in, him or her into my express server. I have a full stack app, mern

  • @WildMemo
    @WildMemo 3 หลายเดือนก่อน

    Explained well! Thank you.

    • @jgoebel
      @jgoebel 3 หลายเดือนก่อน

      Glad you liked it