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

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

suwa yuki
November 21, 2019

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

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

suwa yuki

November 21, 2019
Tweet

More Decks by suwa yuki

Other Decks in Technology

Transcript

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

    View full-size slide

  2. ຊ೔ͷςʔϚ
    2
    -*/&-PHJO"VUIͷ

    ͸͡ΊͷҰาΛ౿Έग़͠

    ࣮૷͕͍͔ʹ؆୯͔ཧղ͢Δ
    ຊ೔ͷςʔϚ

    View full-size slide

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

    View full-size slide

  4. -*/&-PHJOͷ֓ཁͱ࠷৽৘ใ
    4
    O V E R V I E W & N E W F E AT U R E S

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  7. -*/&-PHJOΛར༻͢ΔϞνϕʔγϣϯ
    7
    w."6 ສਓ
    w%"6 ສਓ
    w೔ຊͷਓޱԯສਓ
    wਓޱͷ໿͕ຖ೔ར༻

    ʢਓʹਓ͸ຖ೔࢖͏ʣ
    2019೥12݄ظ ୈ3࢛൒ظܾࢉઆ໌ձ ϓϨθϯςʔγϣϯࢿྉ

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

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

    View full-size slide

  11. ͜Ε·Ͱ
    11
    Logged In!

    View full-size slide

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

    View full-size slide

  13. 13
    "VUIͷ֓ཁͱ࠷৽৘ใ
    O V E R V I E W & N E W F E AT U R E S

    View full-size slide

  14. ೝূೝՄͷػೳΛ
    αʔϏεͱͯ͠ఏڙ

    View full-size slide

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

    View full-size slide

  16. Login with LINE
    ෳ਺ͷιʔγϟϧϩάΠϯ͸ෳࡶʜ
    16
    Login with Facebook
    Sign in with Google
    IDϓϩόΠμ͝ͱʹ
    ೝূ/ೝՄͷ࣮૷ํ๏͕ҟͳΔ

    View full-size slide

  17. ೝূೝՄʹؔ͢Δඪ४ن֨
    17
    ΞϓϦαʔόʔͱ΋ʹ
    ࣗࣾ։ൃ͢Δ৔߹͸։ൃӡ༻ίετ͕͔͔Δ

    View full-size slide

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

    View full-size slide

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

    ϲ݄Ҏ಺Ͱ࣮૷׬ྃ
    Ҏ্ͷ4%,ͱ

    ਺ଟ͘෯޿͍"1*Λఏڙ
    ສҎ্ͷѱҙͷ͋Δ

    ϩάΠϯΛ๷ࢭ
    ಠࣗ·ͨ͸Ҏ্ͷఆ͔ٛΒ

    ϧʔϧΛՃ͑Δ͜ͱ͕Մೳ
    աڈ͔݄ͰҎ্ͷ

    ຊ൪؀ڥͷΞοϓλΠϜ
    ৽͍͠ػೳΛੵۃతʹఏڙɺ

    ຊۀʹϑΥʔΧεͰ͖Δ

    View full-size slide

  20. ਺ଟ͘ͷιʔγϟϧίωΫγϣϯΛαϙʔτ
    And more…

    View full-size slide

  21. ೥݄ʹެࣜαϙʔτ

    ඇৗʹ؆୯ʹ૊ΈࠐΈՄೳʹ

    View full-size slide

  22. ͳͥ-*/&-PHJOͱ"VUIΛ

    ซ༻͢Δඞཁ͕͋Δͷ͔ʁ
    22
    ?

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  26. 26
    ಋೖσϞ
    D E M O

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  32. Mobile Order Walkthrough
    དྷళલʹεϚϗͰυϦϯΫΛ஫จɺ

    ଴ͪ࣌ؒͳ͠Ͱ͙͢ʹड͚औΓɻ
    ཉ͍͠঎඼Λࣗ༝ʹखʹऔΓɺ

    ୀళ͢ΔͱϨδϨεͰࣗಈܾࡁɻ
    Services

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  38. $ 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}"

    View full-size slide

  39. 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

    View full-size slide

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

    View full-size slide

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

    View full-size slide