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

LINE Loginで始めるAuth0の使い方 - 認証基盤をかんたんに構築する方法

Ac7cbf1a95672e989590bb527cdafc8e?s=47 suwa yuki
November 21, 2019

LINE Loginで始めるAuth0の使い方 - 認証基盤をかんたんに構築する方法

LINE DEVELOPER DAY 2019の登壇資料です。

Ac7cbf1a95672e989590bb527cdafc8e?s=128

suwa yuki

November 21, 2019
Tweet

Transcript

  1. -*/&-PHJOͰ࢝ΊΔ "VUIͷ࢖͍ํ Classmethod / Yuki Suwa / 2019.11.21 ೝূج൫Λ͔ΜͨΜʹߏங͢Δํ๏

  2. ຊ೔ͷςʔϚ 2 -*/&-PHJO "VUIͷ
 ͸͡ΊͷҰาΛ౿Έग़͠
 ࣮૷͕͍͔ʹ؆୯͔ཧղ͢Δ ຊ೔ͷςʔϚ

  3. ΞδΣϯμ 3 5 min -*/&-PHJOͷ֓ཁͱ࠷৽৘ใ "VUIͷ֓ཁͱ࠷৽৘ใ ಋೖࣄྫͱ5*14 ·ͱΊ 5 min

    10 min 5 min ΞϓϦ΁ͷಋೖσϞ 10 min
  4. -*/&-PHJOͷ֓ཁͱ࠷৽৘ใ 4 O V E R V I E W

    & N E W F E AT U R E S
  5. -*/&-PHJOͱ͸ w༷ʑͳνϟωϧʹ-*/&ͰϩάΠϯ Ͱ͖ΔػೳΛఏڙ w0"VUI0QFO*%$POOFDU४ڌ 5

  6. ΞϓϦͷೝূೝՄͷ՝୊ wίΞͰ͸ͳ͍͕ඞཁͳػೳͰ͸͋Δ͕ɺ ෳࡶʹͳΓ͕ͪ wೝূͷ69͸ɺશମͷ69ʹڧ͘Өڹ͢Δ w࣌ؒΛ͔͚ͣʹ࡞Γ͍ͨͷʹɺ࣌ؒΛ͔ ͚ͳ͍ͱ࡞Εͳ͍ 6

  7. -*/&-PHJOΛར༻͢ΔϞνϕʔγϣϯ 7 w."6 ສਓ w%"6 ສਓ w೔ຊͷਓޱԯສਓ wਓޱͷ໿͕ຖ೔ར༻
 ʢਓʹਓ͸ຖ೔࢖͏ʣ 2019೥12݄ظ

    ୈ3࢛൒ظܾࢉઆ໌ձ ϓϨθϯςʔγϣϯࢿྉ
  8. ϢʔβʔΛεϐʔσΟʹϩάΠϯঢ়ଶ΁ wސ٬ମݧͷϙΠϯτ͸͍͔ʹૣظஈ֊Ͱ ϩάΠϯঢ়ଶʹ͍͔࣋ͬͯ͘ wσʔλ෼ੳ্΋ૣظஈ֊ͰϢʔβʔΛϢ χʔΫʹಛఆ͍ͨ͠ w΄΅ৗʹϩάΠϯঢ়ଶͰ͋Δ-*/&Λ׆༻ wϢʔβʔʹʮϩάΠϯʯΛҙࣝͤ͞ͳ͍ 8

  9. -*''4%,W w-*''4%,W͕೥݄ʹϦϦʔε w-*/&-PHJOͷ਌࿨ੑ͕޲্ w8FCͰͷར༻͕Ͱ͖ΔΑ͏ʹ 9 liff.isLoggedIn() https://engineering.linecorp.com/ja/blog/liff liff.login() liff.logout() liff.getAccessToken()

    NEW
  10. -*''ͷ4DPQFࢦఆ w-*''ͷొ࿥ํ๏͕มߋʹͳΓ4DPQFࢦఆ͕Մೳʹ wϢʔβʔೝՄΛҰ౓ʹ·ͱΊͯߦ͑ΔΑ͏ʹͳͬͨ 10 NEW

  11. ͜Ε·Ͱ 11 Logged In!

  12. ͜Ε͔Β 12 ઃఆͨ͠ScopeΛ LIFFͷೝՄʹ ௥ՃͰ͖Δʂ Logged In!

  13. 13 "VUIͷ֓ཁͱ࠷৽৘ใ O V E R V I E W

    & N E W F E AT U R E S
  14. ೝূೝՄͷػೳΛ αʔϏεͱͯ͠ఏڙ

  15. ιʔγϟϧϩάΠϯͷ՝୊ w৭ʑͳϩάΠϯखஈΛఏڙ͍ͨ͠ w*%ϓϩόΠμ͝ͱʹ࢓༷͕ҟͳΔ w*%ϓϩόΠμ͝ͱʹΞΫηετʔ ΫϯΛ؅ཧ͢ΔॲཧΛ࣮૷͠ͳ͚ Ε͹͍͚ͳ͍ 15

  16. Login with LINE ෳ਺ͷιʔγϟϧϩάΠϯ͸ෳࡶʜ 16 Login with Facebook Sign in

    with Google IDϓϩόΠμ͝ͱʹ ೝূ/ೝՄͷ࣮૷ํ๏͕ҟͳΔ
  17. ೝূೝՄʹؔ͢Δඪ४ن֨ 17 ΞϓϦαʔόʔͱ΋ʹ ࣗࣾ։ൃ͢Δ৔߹͸։ൃӡ༻ίετ͕͔͔Δ

  18. "VUI͕·Δͬͱղܾʂ

  19. "VUIͷಛ௕ 19 ։ൃεϐʔυ ٕज़ελοΫ ηΩϡϦςΟ ֦ுੑ ύϑΥʔϚϯε Πϊϕʔγϣϯ ͷސ٬͕
 ϲ݄Ҏ಺Ͱ࣮૷׬ྃ

    Ҏ্ͷ4%,ͱ
 ਺ଟ͘෯޿͍"1*Λఏڙ ສҎ্ͷѱҙͷ͋Δ
 ϩάΠϯΛ๷ࢭ ಠࣗ·ͨ͸Ҏ্ͷఆ͔ٛΒ
 ϧʔϧΛՃ͑Δ͜ͱ͕Մೳ աڈ͔݄ͰҎ্ͷ
 ຊ൪؀ڥͷΞοϓλΠϜ ৽͍͠ػೳΛੵۃతʹఏڙɺ
 ຊۀʹϑΥʔΧεͰ͖Δ
  20. ਺ଟ͘ͷιʔγϟϧίωΫγϣϯΛαϙʔτ And more…

  21. ೥݄ʹެࣜαϙʔτ
 ඇৗʹ؆୯ʹ૊ΈࠐΈՄೳʹ

  22. ͳͥ-*/&-PHJOͱ"VUIΛ
 ซ༻͢Δඞཁ͕͋Δͷ͔ʁ 22 ?

  23. -*/&-PHJOҎ֎ͷબ୒ࢶΛ ༻ҙ͍ͨ͠৔߹ʹซ༻͢Δ 23 A

  24. 8FCͷ৔߹ͷ-*/&-PHJO w1$Ͱ-*/&Λ࢖͍ͬͯΔϢʔβʔ͸গͳ͍ w؀ڥʹΑͬͯ͸-*/&-PHJO͕ඞͣ͠΋γʔ ϜϨεͳମݧʹͳΔͱ͸ݶΒͳ͍ wଞͷϩάΠϯखஈ΋ซ༻͍ͨ͠ wιʔγϟϧϩάΠϯ͸"VUIͷಘҙ෼໺ 24

  25. 4JHO*OXJUI"QQMFରԠ w৽نJ04ΞϓϦͰιʔγϟϧϩάΠ ϯΛಋೖ͢Δ͸ඞਢʹ w-*/&-PHJOΛಋೖ͢Δ৔߹΋֘౰ w"VUIͰ͔ΜͨΜʹରԠՄೳ wϢʔβʔΛϦϯΫ͢Δ͜ͱ΋Մೳ 25

  26. 26 ಋೖσϞ D E M O

  27. %FNP"SDIJUFDUVSF 27 iOS App Web App SDK SDK Auth0 Connections

    LIFF App SDK
  28. 'PSJ04 28 iOS App Web App SDK SDK Auth0 Connections

    LIFF App SDK
  29. 'PS-*''"QQ 29 iOS App Web App SDK SDK Auth0 Connections

    LIFF App SDK
  30. 'PS8FC"QQ 30 iOS App Web App SDK SDK Auth0 Connections

    LIFF App SDK
  31. -*/&-PHJOͷ׆༻ࣄྫ 31

  32. Mobile Order Walkthrough དྷళલʹεϚϗͰυϦϯΫΛ஫จɺ
 ଴ͪ࣌ؒͳ͠Ͱ͙͢ʹड͚औΓɻ ཉ͍͠঎඼Λࣗ༝ʹखʹऔΓɺ
 ୀళ͢ΔͱϨδϨεͰࣗಈܾࡁɻ Services

  33. LINE Login LINE Pay Messaging API ιʔγϟϧϩάΠϯ ঎඼ͷܾࡁ νϟοτϘοτ஫จ

  34. 5*14 34

  35. -*/&ͷೝՄΛճͰࡁ·͍ͤͨ w-*''ͷ4DPQFΛར༻͢Δ w"VUI΁ͷ-*/&$POOFDUJPOʹಉ͡$IBOOFM*%  $IBOOFM4FDSFUΛઃఆ͢Δ͜ͱͰ"VUI͔ΒͷೝՄ͕ ෆཁʹͳΔ w"VUI΁ͷϩάΠϯϦΫΤετ࣌ʹ$POOFDUJPOΛࢦఆ ͢Δ͜ͱͰϩάΠϯը໘ΛεΩοϓͰ͖Δ 35

  36. 36 Logged In! Auth0 (Auto Redirect) LIFF APP

  37. CPU@QSPNQUΛ௥Ճ͍ͨ͠ w8FC"QQͰϩάΠϯ͢Δࡍʹɺಉ࣌ʹ༑ͩͪ௥Ճ΋ೝՄ ͯ͠΋Β͍͍ͨ w-*/&-PHJOͰ͸CPU@QSPNQUύϥϝʔλΛ෇༩͢Δ͜ͱ ͰೝՄʹՃ͑Δ͜ͱ͕Մೳ w"VUI.BOBHFNFOU"1*ͷ6QEBUF$POOFDUJPOΛ࢖͏ ͜ͱͰ"VUIPSJ[BUJPO3FRVFTU΁ͷύϥϝʔλΛ௥Ճ͢ Δ͜ͱ͕Մೳ 37

  38. Logged In! LINE Login࣌ʹ ༑ͩͪ௥Ճ΋ ߦ͍͍ͨ

  39. $ curl -XPATCH -H "Authorization: Bearer $TOKEN" -d {"options":{ "client_id":"xxx",

    "client_secret":"xxx", "upstream_params":{ "bot_prompt":{ “value":"Normal"} } }} "https://{tenant}.auth0.com/api/v2/connections/{con_id}"
  40. https://access.line.me/oauth2/v2.1/authorize ?client_id=YOUR_CLIENT_ID &response_type=code &redirect_uri=https://YOUR_APP/callback &scope=openid &bot_prompt=Normal

  41. ·ͱΊ 41 S U M M A R Y

  42. ·ͱΊ w-*/&-PHJOͰϢʔβʔͷγʔϜϨεͳೝূମݧΛఏڙ w-*/&-PHJOͰิ͍͖Εͳ͍ೝূମݧΛ"VUIͰิڧ wࡉ΍͔ͳઃఆͰೝূମݧΛվળͰ͖Δ w͔ΜͨΜʹಋೖͰ͖ΔͷͰɺ·ͣ͸ࢼͯ͠ΈΑ͏ʂ 42