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
690
ズボラ旅開発のLINE APIとの歩み
pochisato
0
750
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
エンジニアとして関わる要件と仕様(公開用)
murabayashi
0
300
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.8k
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.2k
みんなでプロポーザルを書いてみた
yuriko1211
0
280
受け取る人から提供する人になるということ
little_rubyist
0
250
距離関数を極める! / SESSIONS 2024
gam0022
0
290
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
190
Jakarta EE meets AI
ivargrimstad
0
220
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
120
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
2k
Amazon Qを使ってIaCを触ろう!
maruto
0
410
watsonx.ai Dojo #4 生成AIを使ったアプリ開発、応用編
oniak3ibm
PRO
1
140
Featured
See All Featured
A Tale of Four Properties
chriscoyier
156
23k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Facilitating Awesome Meetings
lara
50
6.1k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
Building Applications with DynamoDB
mza
90
6.1k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Typedesign – Prime Four
hannesfritz
40
2.4k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Embracing the Ebb and Flow
colly
84
4.5k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Side Projects
sachag
452
42k
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