Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Firebase Authenticationでカスタム認証システムをつかう勘所@Fireba...
Search
pochi-sato
May 28, 2019
Programming
6
2.4k
Firebase Authenticationでカスタム認証システムをつかう勘所@Firebase Meetup #13
認証疎いのですががんばりました
pochi-sato
May 28, 2019
Tweet
Share
More Decks by pochi-sato
See All by pochi-sato
JP_Stripes Deep Dive vol. 6 [Stripe Payment Links]
pochisato
0
76
副業しやすい会社/しにくい会社
pochisato
2
570
LINEでプロダクト検討時に知っててほしい5つの武器
pochisato
0
680
ズボラ旅開発のLINE APIとの歩み
pochisato
0
740
Firestore導入前に検討したかったベスト5@Firebase Meetup #10
pochisato
9
2.2k
Realtime Config with Firestore@Firebase Meetup #8
pochisato
3
540
Other Decks in Programming
See All in Programming
シールドクラスをはじめよう / Getting Started with Sealed Classes
mackey0225
3
390
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
0
150
Piniaの現状と今後
waka292
5
1.4k
Progressive Web Apps für Desktop und Mobile mit Angular (Hands-on)
christianliebel
PRO
0
110
Server Driven Compose With Firebase
skydoves
0
390
飲食業界向けマルチプロダクトを実現させる開発体制とリアルな現状
hiroya0601
1
390
Sidekiqで実現する 長時間非同期処理の中断と再開 / Pausing and Resuming Long-Running Asynchronous Jobs with Sidekiq
hypermkt
6
2.6k
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
130
現場で役立つモデリング 超入門
masuda220
PRO
12
2.9k
AWS IaCの注目アップデート 2024年10月版
konokenj
3
3k
Kubernetes for Data Engineers: Building Scalable, Reliable Data Pipelines
sucitw
1
190
詳細解説! ArrayListの仕組みと実装
yujisoftware
0
470
Featured
See All Featured
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Product Roadmaps are Hard
iamctodd
PRO
48
10k
Statistics for Hackers
jakevdp
796
220k
YesSQL, Process and Tooling at Scale
rocio
167
14k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.1k
The Power of CSS Pseudo Elements
geoffreycrofte
72
5.3k
Designing on Purpose - Digital PM Summit 2013
jponch
115
6.9k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.6k
Adopting Sorbet at Scale
ufuk
73
9k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Fireside Chat
paigeccino
32
3k
Transcript
Firebase AuthenticationͰ ΧελϜೝূγεςϜΛ ͔ͭ͏צॴ
ࣗݾհ • ͞ͱ͏ɹͨ͘ͱʢΆͪʣ • Ӧۀ→ΤϯδχΞ→ਓࣄ→͍·ʂʂ @pitown https://twitter.com/pitown
ࣗݾհ ࣄHotspringͱ͍͏ձࣾͰɺʮζϘϥ ཱྀʯͱ͍͏αʔϏεͳͲɺ ͬͱؾܰʹཱྀߦߦ͚ΔαʔϏεΛͭ ͍ͬͯ͘·͢ɻ 3ਓͷΤϯδχΞ͕࠷ۙೖࣾ͠·ͨ͠ʂ
Ͱຊ
Firebase AuthenticationͰ ΧελϜೝূγεςϜΛ ͔ͭ͏צॴ
2ϓϩδΣΫτͰAuthentication UserΛ Syncͤ͞Δ ʙLINEϩάΠϯΛͬͨΧελϜϩάΠ ϯͰΔฤʙ ݩλΠτϧͷ··ߦ͘ͱ LTʹͳΒͳ͍ or ࣗݾຬ ͬΆ͍ͷͰɺΊ·ͨ͠..
2ϓϩδΣΫτؒͰͷೝূ·ͨ͗ͷڵຯ͋Δͻͱ ͋ͱͰฉ͍͍ͯͩ͘͞ʂ ΧελϜೝূγεςϜΛར༻͢ΔͭͰ͢ɻ ͳ͓ɺ݁ߏͳΨνཁ͕݅ͳ͍ͱɺ 2ϓϩδΣΫτؒͰ·͙ͨͳΜͯɺ ςΫΓ͍͗ͯͯ͢աͳ࣮ʹͳ͍ͬͯΔ ͜ͱ͕ଟ͍ؾ͕͢ΔͷͰɺ·ͣͦ͜ͷݟ͔͠Βɻɻ
Custom Authenticate System
ΧελϜೝূγεςϜ
Firebaseͷೝূɺ ͘͘͢͢͝͝ศརͰ͢
ͨ͘͞ΜͷϓϩόΠμΛɺ σϑΥϧτͰαϙʔτ͍ͯ͠·͢
None
None
!?
ຊͰར༻80%ͷSNS͕ແ͍..
None
ͭ·ΓɺLINEΛར༻ͯ͠ ϩάΠϯ͢Δʹɺ ΧελϜೝূΛΘͳ͍ͱ ͍͚ͳ͍ʂ
"VUI 6TFST ᶄpSFCBTFʹαΠϯΠϯɻ 'JSFCBTF6TFSΛऔಘ :PVS "QQMJDBUJPO ͍ΘΏΔϑΣσϨʔγϣϯ*%ϓϩόΠμͳΒ͜͏ͬͯɺ 4%,͕͏·͍͜ͱͬͯ͘ΕΔΠϝʔδͳΜͰ͕͢ɺ 'JSFCBTF $MJFOU
4%, ᶃΑ͠ͳʹͬͯ͘ΕΔ
:PVS 4FSWFS "VUI 6TFST ᶈUPLFOͰpSFCBTFʹαΠϯΠϯɻ 'JSFCBTF6TFSΛऔಘ ᶃೝূ ᶅWFSJGZ͢Δ :PVS "QQMJDBUJPO
ᶄೝূͰಘͨ JE UPLFOΛTFSWFS ᶇ'JSFCBTFUPLFO Β͏ ᶆ$SFBUF -*/&ΛͬͨΧελϜೝূͩͱ͜͏ -*/&αʔό
ͦ͜͠͏͚ͩͲͬͯΔͷɺ ᶃLINEͱͷೝূΛߦͬͯɺLINEͷIDɺTokenΛΒ͏ ᶄͦΕΒΛݩʹɺFirebase Authenticationʹอଘ͠ʹ͍͘ ͚ͬͯͩͰ͢
άάΕ࣮ग़ͯ͘ΔͷͰɺ ᶃͷɺ LINEͱΓऔΓ͢Δ෦লུʂʂ
:PVS 4FSWFS "VUI 6TFST ᶈUPLFOͰpSFCBTFʹαΠϯΠϯɻ 'JSFCBTF6TFSΛऔಘ ᶃೝূ ᶅWFSJGZ͢Δ :PVS "QQMJDBUJPO
ᶄೝূͰಘͨ JE UPLFOΛTFSWFS ᶇ'JSFCBTFUPLFO Β͏ ᶆ$SFBUF -*/&αʔό -*/&ଆͰͷೝূΛऴ͑ͯɺࣗલͷαʔόͰWFSJGZऴ͑ͯɺ ͋͞ɺ-*/&ͷ*%Ͱ'JSFCBTF"VUIFOUJDBUJPOͱབྷΉͧʂ ͱ͍͏ͱ͜Ζ ͚ͩ͜͜આ໌͠·͢
:PVS 4FSWFS "VUI 6TFST ͦ͜ͰԿΛͬͯΔ͔ͱ͍͏ͱɺ -*/& *% ˞લʹɺ-*/&ଆͰͷ ೝূΛͯ͠ɺ-*/&*% ΛखʹೖΕͨޙͷ
ఆͰ͢
:PVS 4FSWFS "VUI 6TFST ϢʔβʔΛखಈͰ࡞ͬͯΔ͚ͩͰ͢ ͓खखͰϢʔβʔ࡞ DSFBUF6TFS -*/& *% ˞લʹɺ-*/&ଆͰͷ
ೝূΛͯ͠ɺ-*/&*% ΛखʹೖΕͨޙͷ ఆͰ͢ Ϣʔβʔ࡞ΛͰ͖Δͷ"ENJO4%,͚ͩαʔόαΠυͰ͚ͩɻ ͳͷͰαʔό͕ඞཁͳͷΑͶ
͜ͷͱ͖ʹɺΩϗϯಉ͜͡ͱΛ͍ͯ͠ΔΜ͚ͩͲɺ ϑΣσϨʔγϣϯʙʙʙͱܾఆతʹҧ͏ͱ͜Ζ͕;ͨͭ͋Δɻ
ϑΣσϨʔγϣϯʙʙʙͩͱ 6TFSQSPWJEFS%BUBQSPWJEFS*Eʹ֨ೲ͞Ε͍ͯΔʂ ᶃ1SPWJEFS͕-*/&͍ͩͬͯ͏͜ͱΛอଘ͢Δઐ༻ͷॴ͕ͦͦͳ͍ɻ ˠطʹϩάΠϯͨ͠ਓΛ୳͢ೝূϓϩόΠμͷείʔϓ͕ߜΕͳ͍
ϑΣσϨʔγϣϯʙʙʙͩͱ 6TFSQSPWJEFS%BUBVJEʹ֨ೲ͞Ε͍ͯΔ ᶄ-*/&ͷ*%Λอଘ͓ͯ͘͠ઐ༻ͷॴͦͦͳ͍ɻ ˠ-*/&͔ΒૹΒΕ͖ͯͨ6TFS*%ΛݟͯɺͲͷਓ͔ݕࡧ͕Ͱ͖ͳ͍
ཁɺUserΛͭͬͨ͋͘ͱͰɺ ͥΜͥΜ୳ͤͳ͍ͬ͢
ͦ͜Ͱొ͢Δͷ͕ɺFirebase Authentication Userͷuidɻ
'JSFCBTF$POTPMFͷBVUIFOUJDBUJPOͷϖʔδ ίϨͷ͜ͱɻ
'JSFCBTF$POTPMFͷBVUIFOUJDBUJPOͷϖʔδ ίϨͷ͜ͱɻ
͜ͷuidɺΧελϜೝূγεςϜͰ ͏߹ɺࣗ༝ʹઃఆͰ͖ΔΘ͚Ͱ͢ (ϑΣσϨʔγϣϯʙʙϥϯμϜʹͳΔ)
ͦͯ͠ɺ͜ͷuidΛΩʔʹɺ ϢʔβʔΛऔಘ͢Δ͜ͱͰ͖ΔΘ͚Ͱ ͢
Ұ൪Լ͕࣮MJOFϩάΠϯ -*/&ͰϩάΠϯ (PPHMFͰϩάΠϯ (PPHMFͰϩάΠϯ
Ұ൪Լ͕࣮MJOFϩάΠϯ σϑΥͷϓϩόΠμͰ ϥϯμϜจࣈྻͰ Ϣʔβʔੜ͞ΕΔ
Ұ൪Լ͕࣮MJOFϩάΠϯ ΧελϜϩάΠϯͰɺ ࣗͰࣗ༝ʹͭ͘ΕΔʂ
Ұ൪Լ͕࣮MJOFϩάΠϯ MJOFͬͯݟ͑ͯΔ͚Ͳɺ ϢχʔΫʹͳΔΑ͏ʹɺ \1SPWJEFS*E^\1SPWJEFS6TFS*E^ ͷܗͰอଘʂ
ͦΕ͚ͩͰ͢
͜Ε͕צॴɻ \1SPWJEFS*E^\1SPWJEFS6TFS*E^ ͬͯVJEͰอଘ͢Δ
ίʔυ
͜ΕΛαʔόͰɺ"ENJO4%,ͬͯΔɻ
؆୯ʹ·ͱΊΔͱɺ ᶃΧελϜೝূγεςϜΛ͏߹ɺ1SPWJEFS*Eͱ1SPWJEFS6TFS*E͕ อଘ͞Εͳ͍Α ᶄͳͷͰɺ\1SPWJEFS*E^\1SPWJEFS6TFS*E^ͱ͍͏VJEͰϢʔβʔΛ ͭ͘ΔΑ
Γํͱͯ͠ɺ ᶃαʔόΛࣗલͰ༻ҙ͢Δ ͳΜͰࣗ͝༝ʹ ᶄαʔόͷ"ENJO4%,Λ͔ͭͬͯϢʔβʔΛͭ͘Δɻ ɹ\1SPWJEFS*E^\1SPWJEFS6TFS*E^ɹͱ͍͏VJEͰͭ͘Δɻ ᶅطଘϢʔβʔΛҾ͖ʹ͍͘ͱ͖ɺVJEΛΩʔʹ͢ΕҾ͚·͢
͍͞͝ʹิ
ͻͱͭɺ͜ͷΓํʹҙ͕͋ͬͯɻ ॳճ(PPHMFͰೝূͪ͠Ό͚ͬͨͲɺ ޙ͔Β-*/&ʹೝূϦϯΫ͚͍ͭͨΑɺ ͱ͍͏ͷɻ ͦͷ߹ɺطʹVJE͕ϥϯμϜจࣈྻͰอଘ͞Ε͍ͯͯɺࠓճͷΓํΛద༻Ͱ͖ͳ͍ɻ ͷࠓͷཧղͰɺ'JSFCBTF"VUIFOUJDBUJPOͷอଘྖҬɺ ɾVJE ΧελϜೝূγεςϜ࣌ͷΈ ɾDMBJN
ݖݶͱͯ͠͏ɺσʔλαΠζ্ݶ͋Γ ɾσϑΥͳใ FNBJMFNBJM7FSJpFEQIPOF/VNCFSQBTTXPSEEJTQMBZ/BNF QIPUP63-EJTBCMFE ͷΈͳͷͰɺ֎෦ʹอଘྖҬ͕ඞཁɻ ྫ͑ɺNBQQJOHςʔϒϧΈ͍ͨͳͷΛɺ'JSFTUPSFͷ$PMMFDUJPOʹ࡞ͬͨΓ͢Δඞཁ͕͋ Δɻ ͦ͜·ͰΓ͍͔༷ͨ࣍ୈʜ ͩΕ͔͍͍Γํ͋ͬͨΒ͓͍͑ͯͩ͘͠͞
͓ΘΓ ใަ͠·͠ΐ͏ʂ Firestore͜Ε͔ΒΔͻͱɺ ͬͯΔͻͱɺ ͠·͠ΐ͏ʂ @pitown https://twitter.com/pitown