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
580
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
550
Other Decks in Programming
See All in Programming
return文におけるstd::moveについて
onihusube
1
1.1k
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
200
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
260
php-conference-japan-2024
tasuku43
0
310
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
180
これでLambdaが不要に?!Step FunctionsのJSONata対応について
iwatatomoya
2
3.7k
Amazon S3 NYJavaSIG 2024-12-12
sullis
0
100
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
130
Zoneless Testing
rainerhahnekamp
0
120
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
250
42 best practices for Symfony, a decade later
tucksaun
1
180
各クラウドサービスにおける.NETの対応と見解
ymd65536
0
100
Featured
See All Featured
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
2
290
Product Roadmaps are Hard
iamctodd
PRO
49
11k
GitHub's CSS Performance
jonrohan
1030
460k
We Have a Design System, Now What?
morganepeng
51
7.3k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
Embracing the Ebb and Flow
colly
84
4.5k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Making the Leap to Tech Lead
cromwellryan
133
9k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
A Philosophy of Restraint
colly
203
16k
Facilitating Awesome Meetings
lara
50
6.1k
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