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

IonicアプリをAuth0で認証する - Ionic Meetup #16 in Online

IonicアプリをAuth0で認証する - Ionic Meetup #16 in Online

Hayato OKUMOTO

April 07, 2021
Tweet

More Decks by Hayato OKUMOTO

Other Decks in Technology

Transcript

  1. w ؅ཧ"1*͕ෆ଍͍ͯ͠Δ w 1BTTXPSE$SFEFOUJBMT'MPXʹ͔͠ରԠ͍ͯ͠ͳ͍ w Ϣʔβ͔Β*%ύεϫʔυΛड͚औΔํࣜ w ը໘Λ͍͍ͪͪ࡞Δඞཁ͕͋Δ ఏڙ͍ͯ͠Δ6*΋͋Δ͚Ͳʜ 

    w αʔυύʔςΟʔͷೝূʹ͸ద͞ͳ͍ w ΞϓϦ41"ʹ͸ద͍ͯ͠Δ͕ඪ४తͳ8FCΞϓϦͷೝূʹ͸࢖͑ͳ͍ 'JSFCBTF"VUIͷσϝϦοτ 7
  2. "VUIͱ͸ 12 ϝϦοτ ◦ ෳ਺ΞϓϦؒͷೝূϋϒʹͳΕΔ 0"VUI1SPWJEFS  ◦ 8FC ωΠςΟϒࠞࡏ͢Δ؀ڥͰ౷Ұͨ͠ೝূ͕࣮ݱ͠΍͍͢

    ◦ ؅ཧ"1*͕ॆ࣮͍ͯ͠Δ σϝϦοτ ◦ ྉۚମܥతʹUP$ͷແྉαʔϏεͷ৔߹͸ཁݕ౼ ◦ ᙱ͍ͱ͜Ζʹख͕ಧ͔ͳ͍͜ͱ͕͠͹͋͠Δ 

  3. • Auth0 ͷ OAuth 2.0ͷೝՄϑϩʔΛར༻͢Δ • ΞϓϦͰOAuthΛར༻͢Δ৔߹ • Authorization Code

    Flow with Proof Key for Code Exchange (PKCE ) • PKCEΛ࢖͏͜ͱ͕ॏཁɿԣऔΓ߈ܸ΁ͷ଱ੑ Auth0ΛIonicʹ࣮૷͢Δ 13
  4. Authorization Code + PKCE Flow 14 https://auth0.com/docs/ fl ows/authorization-code- fl

    ow-with-proof-key-for-code-exchange-pkce 1. In-app BrowserΛ্ཱͪ͛
  5. Authorization Code + PKCE Flow 15 https://auth0.com/docs/ fl ows/authorization-code- fl

    ow-with-proof-key-for-code-exchange-pkce 3. Custom URL SchemeͰΞϓϦʹίʔϧόοΫ 4. ΞΫηετʔΫϯΛऔಘ 5. ΞΫηετʔΫϯͰAPIʹΞΫηε 2. ϩάΠϯ
  6. • Ͱ΋΍ͬͺΓɺCapacitorͰ࣮૷͍ͨ͠ΑͶ • ެࣜͷ৘ใ͸ແ͍ → جຊʹै࣮ͬͯ૷͢Ε͹Α͍ • +φ΢͍@auth0/auth0-spa-jsύοέʔδΛ࢖͍͍ͨ • چJS

    SDK͸ίʔϧόοΫ஍ࠈ • ↑Λ͞Βʹϥοϓͨ͠ @auth0/angularύοέʔδ·Ͱ͋Δ Auth0ΛIonicʹ࣮૷͢Δ 17 https://github.com/auth0/auth0-spa-js
  7. ·ͱΊ 23 • Auth0ΛIonicʹ૊ΈࠐΜͰΈͨ • PWA + ωΠςΟϒཱ྆ͨ͠ΞϓϦ • CapacitorͰ͸࠷৽ͷJS

    SDKͰ͸मਖ਼͕ඞཁͰ͢ • ࠓޙ • CapacitorͷAuth0ωΠςΟϒSDKͭ͘Γ͍ͨ