Lock in $30 Savings on PRO—Offer Ends Soon! ⏳

OAuth 2.0 Authorization Code Flow

OAuth 2.0 Authorization Code Flow

demos for OAuth 2.0 Authorization Code Flow

Ching Yi Chan

February 15, 2020
Tweet

More Decks by Ching Yi Chan

Other Decks in How-to & DIY

Transcript

  1. Email login Password username email password WHERE email = ?

    AND password = ? hi {username} login failed
  2. login with google Email Password twjug-lite.com accounts.google.com login No Yes

    你同意 TWJUG lite 使 用 OOO XXX 嗎? accounts.google.com
  3. login with google Email Password twjug-lite.com accounts.google.com login No Yes

    accounts.google.com twjug-lite.com/callback loading ... xxx.google.com 你同意 TWJUG lite 使 用 OOO XXX 嗎?
  4. login with google Email Password twjug-lite.com accounts.google.com login Yes accounts.google.com

    twjug-lite.com/callback loading ... xxx.google.com Client Authorization Sserver Resource Server User-Agent, a.k.a. 瀏覽器 Consent Resource Owner 你同意 TWJUG lite 使 用 OOO XXX 嗎?
  5. login with google Email Password twjug-lite.com accounts.google.com login No Yes

    accounts.google.com 1 response_type: code redirect_uri: twjut-lite.com/callback go to authorization server 你同意 TWJUG lite 使 用 OOO XXX 嗎?
  6. login with google Email Password twjug-lite.com accounts.google.com login No Yes

    accounts.google.com twjug-lite.com/callback loading ... 1 2 response_type: code redirect_uri: twjut-lite.com/callback go to authorization server Back to redirect URI with authorization code 你同意 TWJUG lite 使 用 OOO XXX 嗎?
  7. login with google Email Password twjug-lite.com accounts.google.com login No Yes

    accounts.google.com twjug-lite.com/callback loading ... 1 2 3 response_type: code redirect_uri: twjut-lite.com/callback go to authorization server Back to redirect URI with authorization code Exchange authorization code for access token 你同意 TWJUG lite 使 用 OOO XXX 嗎?
  8. login with google Email Password twjug-lite.com accounts.google.com login No Yes

    accounts.google.com twjug-lite.com/callback loading ... 1 2 xxx.google.com 3 4 response_type: code redirect_uri: twjut-lite.com/callback go to authorization server Back to redirect URI with authorization code Exchange authorization code for access token Talk to resource server with access token 你同意 TWJUG lite 使 用 OOO XXX 嗎?
  9. login with google Email Password twjug-lite.com accounts.google.com login 1 client_id:

    xxxx response_type: code redirect_uri: twjut-lite.com/callback go to authorization server 0 向 OAuth Provider 註冊你的 Client 取得 client_id, client_secret
  10. Email Password accounts.google.com login No Yes accounts.google.com twjug-lite.com/callback loading ...

    2 Back to redirect URI with authorization code Exchange authorization code for access token 你同意 TWJUG lite 使 用 OOO XXX 嗎? 3