Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Auth0ハンズオンウェビナー資料

suwa yuki
March 04, 2020

 Auth0ハンズオンウェビナー資料

2020年3月に、認証認可プラットフォーム「Auth0」のハンズオンウェビナーを開催しました。そのウェビナーの資料です。

ブログとあわせてご覧ください。
https://dev.classmethod.jp/server-side/auth0/auth0-hands-on-webinar-basic/

suwa yuki

March 04, 2020
Tweet

More Decks by suwa yuki

Other Decks in Technology

Transcript

  1. εέδϡʔϧ wςφϯτͷ࡞੒ w41"ͷೝূ w$POOFDUJPO w6OJWFSTBM-PHJO w3VMFT 2 Part1 جຊฤ 60min

    Part2 ൃలฤ 60min w6TFS-JOL w3#"$ w$VTUPN%# w:".-*NQPSU&YQPSU w"%࿈ܞ %FNPͷΈ 1 2 3 4 5 6 7 8 9 10
  2. 41"ͷೝূͷ࢓૊Έ 9 Web App
 (SPA) Auth0 ( IdP ) ᶄAuth0ͷϩάΠϯϖʔδʹ


    ϦμΠϨΫτ ᶃϩάΠϯϘλϯΛ
 ԡ͢ ᶅϩάΠϯॲཧ ᶆݩͷϖʔδʹࣗಈϦμΠϨΫτͯ͠
 ID Token / Access TokenΛऔಘ
  3. 13

  4. "MMPXFE$BMMCBDL63-Tͱ͸ 17 Web App
 (SPA) Auth0 ( IdP ) ᶆݩͷϖʔδʹࣗಈϦμΠϨΫτͯ͠


    ID Token / Access TokenΛऔಘ Auth0͔ΒϦμΠϨΫτ͢ΔURL͸ϗϫΠτϦετͰ؅ཧɻ ·ͨAuth0ͷAPIΛ࣮ߦ͢Δ৔߹͸Cross-Origin͕ൃੜ͢ΔͨΊ
 OriginΛϗϫΠτϦετͰ؅ཧ (Allowed Origins)ɻ
  5. Desktop App Web App Mobile App Auth0 ( IdP )

    LINE Facebook Google Database User User User User User User User User User User
  6. Desktop App Web App Mobile App Auth0 ( IdP )

    LINE Facebook Google Database User User User User User User User User User User
  7. ϩʔϧ͝ͱͷΞΫηε੍ޚ 3#"$ w͋Β͔͡Ίઃఆ͞Εͨ3PMFͱ1FSNJTTJPOʹج͖ͮ
 ϢʔβʔʹϦιʔεͷΞΫηεݖݶΛ༩͑Δ Roles Permissions Resource Users User Manager

    Admin ਃ੥ऀ ਃ੥ঝೝऀ ؅ཧऀ Roleͷ෇༩ ਃ੥ͷ࡞੒ ਃ੥ͷऔΓԼ͛ ਃ੥ͷঝೝ ਃ੥API ؅ཧAPI 7
  8. αϯϓϧΞϓϦέʔγϣϯͷमਖ਼ 39 public/js/app.js 11 const options = { 12 redirect_uri:

    window.location.origin, 13 audience: 'https://example.jp' 14 });
  9. αϯϓϧΞϓϦέʔγϣϯͷमਖ਼ 40 public/js/app.js 103 const token = await auth0.getTokenSilently({ 104

    audience: 'https://example.jp' 105 }); 106 console.log(token); 107 return;
  10. ςφϯτ৘ใΛ*NQPSU&YQPSU͢Δ 49 # Export $ a0deploy export \ -c config.json

    -f yaml -o . # Import (Deploy) $ a0deploy import \ -c config.json -i tenant.yaml