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
Laravel + Auth0 + Stripe でECサイトを作ってみた
Search
Takayuki
May 06, 2019
Programming
3
3.3k
Laravel + Auth0 + Stripe でECサイトを作ってみた
Laravel + Auth0 + Stripe でECサイトを作ってみた
Takayuki
May 06, 2019
Tweet
Share
More Decks by Takayuki
See All by Takayuki
エンジニアのキャリア論
bumptakayuki
0
110
地方カンファレンス主催のススメ
bumptakayuki
1
150
Laravelで敢えて試す脆弱性のある書き方
bumptakayuki
1
750
地方でのPHPエンジニア採用って実際どうなの?
bumptakayuki
0
520
沖縄観光、名物を一挙紹介!
bumptakayuki
2
530
Laravel ShiftでLaravelのバージョンアップしてみた話
bumptakayuki
1
1.7k
flutterでイベントアプリを作ってみた
bumptakayuki
0
110
オフショア開発の辛みと学んだ事
bumptakayuki
0
340
ChatGPTにStripeのサンプルコードを書かせてみた
bumptakayuki
1
160
Other Decks in Programming
See All in Programming
RailsのPull requestsのレビューの時に私が考えていること
yahonda
5
1.7k
Vue.js学習の振り返り
hiro_xre
2
130
Modern Angular: Renovation for Your Applications
manfredsteyer
PRO
0
210
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
1
290
カラム追加で増えるActiveRecordのメモリサイズ イメージできますか?
asayamakk
4
1.5k
Jakarta Concurrencyによる並行処理プログラミングの始め方 (JJUG CCC 2024 Fall)
tnagao7
1
230
Realtime API 入門
riofujimon
0
110
現場で役立つモデリング 超入門
masuda220
PRO
13
2.9k
Importmapを使ったJavaScriptの 読み込みとブラウザアドオンの影響
swamp09
4
1.2k
Universal Linksの実装方法と陥りがちな罠
kaitokudou
1
220
Outline View in SwiftUI
1024jp
1
120
Boost Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
840
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
180
21k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
How to train your dragon (web standard)
notwaldorf
88
5.7k
What's in a price? How to price your products and services
michaelherold
243
12k
BBQ
matthewcrist
85
9.3k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
Docker and Python
trallard
40
3.1k
Fontdeck: Realign not Redesign
paulrobertlloyd
81
5.2k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Code Review Best Practice
trishagee
64
17k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Art, The Web, and Tiny UX
lynnandtonic
296
20k
Transcript
Laravel Auth0 Laravel Auth0
3 LaravelͰͷ࣮ํ๏ Agenda 2 Auth0ͱ 1 ࣗݾհ 4 Demo
1 ࣗݾհ
4 ࣗݾհ ◆໊લ ླ ೭(Suzuki Takayuki) ◆ࣗݾհ ɾ1990ɺਆಸݝੜ·Εɻ ɾࣾձਓʹͳ͔ͬͯΒɺϓϩάϥϛϯάΛ࢝ΊΔɻ ɾ2015ʹϑϧεϐʔυʹೖࣾ͠ɺ2017ʹϑϦʔϥ
ϯεΛͬͨޙʹ201711݄ʹԭೄͰىۀɻ ◆झຯ ίεϓϨɺԻָϥΠϒɺϚϥιϯେձʹग़Δɺٿ؍ ઓ ◆Twitter @kanbo0605
Copyright Re:Build.inc All Rights Reserved. 1.ձࣾհ ◆ձ໊ࣾ גࣜձࣾRe:Build ◆ॅॴ ԭೄݝԭೄࢢதԝ̍ஸ̍̒−̕
◆ࣄۀ༰ ɾࣗࣾWEBαʔϏεͷاըɾ։ൃɻ ɾडୗ։ൃ ◆ࣾһ 5໊ ◆ΤϯδχΞͷಇ͖ํ ϦϞʔτϫʔΫՄೳͳࣗ༝ͳಇ͖ํΛਪͯ͠·͢ʂ
2 Auth0ͱ
7 Auth0ͱ ɾ֓ཁ Auth0WebΞϓϦϞόΠϧɺAPIͳͲ ʹରͯ͠ೝূɾೝՄͷαʔϏεΛΫϥυ Ͱఏڙ͍ͯ͠Δɺ͍ΘΏΔIDaaS (Identity as a Service)ϕϯμʔͰ͢ɻ
ɾΦεεϝͷํ اۀ͕ͭWebΞϓϦέʔγϣϯAPI, Native Mobile AppͳͲͰϢʔβʔೝূ ೝՄɺηΩϡϦςΟΛΈࠐΈ͍͚ͨΕ Ͳ࣮͕͍͠ɻ https://qiita.com/furuth/items/8826b66a3ec2b2b14222
8 ֤ݴޠ͝ͱͰνϡʔ τϦΞϧ͕ॆ࣮ͯ͠ ͓Γɺ؆୯ʹಋೖͰ ͖·͢ɻ ओཁͳSNSͱ΄ͱΜͲ࿈ ܞ͓ͯ͠Γɺ࿈ܞํ๏ ؆୯ͰศརͰ͢ɻ WebΞϓϦɺSPAΞϓϦωΠ ςΟϒΞϓϦͳͲʹ࿈ܞͰ
͖ͯɺϢʔβใΛҰݩཧ Ͱ͖Δɻ ؆୯ʹಋೖͰ͖Δ ϢʔβೝূΛҰݩཧͰ ͖Δ ϝϦοτɾಛ ๛ͳ࿈ܞઌ 2 ʙϝϦοτʙ 1 3
9 ๛ͳ࿈ܞઌ Auth0ͱ
1 0 ϢʔβΛҰݩཧ Auth0ͱ
11 ෳͷσόΠεʹରԠ Auth0ͱ
1 2 ྉۚମܥ https://auth0.com/pricing
3 LaravelͰͷ࣮ํ๏
ΞϓϦέʔγϣϯ ϩάΠϯ͔Βܾࡁ·ͰͷྲྀΕ /index TOPϖʔδ ৄࡉϖʔδભҠ ࣌ʹϩάΠϯ ϩάΠϯޭͨ͠Β ηογϣϯLaravelଆ Ͱཧ ೝূ
ܾࡁ ߪೖ͔Βܾࡁը໘
1 5 ެࣜͷAuth0ͷLaravelνϡʔτϦΞϧ https://auth0.com/docs/quickstart/webapp/laravel/01-login
1 6 खॱ ᶃAuth0ͷཧը໘ͰΞϓϦέʔγϣϯͷઃఆΛߦ͏ɻ ᶄLaravelΛΠϯετʔϧ ᶅcomposer require auth0/login:”~5.0" Λ࣮ߦ ᶆLoginServiceProviderΛઃఆ
ᶇphp artisan vendor:publishΛ࣮ߦ ᶈ.envΛฤू ᶉroutes/api.phpΛฤू ᶊίϯτϩʔϥΛ࡞ ᶋconfig/auth.phpΛฤू ᶌbladeϑΝΠϧΛฤू
1 7 ᶃAuth0ͷཧը໘ͰΞϓϦέʔγϣϯͷઃఆΛߦ͏ɻ
1 8 ᶄLaravelΛΠϯετʔϧ https://readouble.com/laravel/5.5/ja/installation.html
1 9 ᶅcomposer require auth0/login:”~5.0" Λ࣮ߦ Auth0ϓϥάΠϯΛΠϯετʔϧ Πϯετʔϧ͕ྃ͢Δͱɺ2ͭͷϓϥάΠϯ͕Ճ͞ΕΔɻ vendor\auth0\auth0-php vendor\auth0\login
2 0 ᶆLoginServiceProviderΛઃఆ config/app.phpΛฤू ԼهΛՃ
2 1 ᶆLoginServiceProviderΛઃఆ AppServiceProvider .phpΛฤू ԼهΛՃ
2 2 ᶇphp artisan vendor:publishΛ࣮ߦ ྃ͢Δͱɺconfig/laravel-auth0.php͕࡞͞Εɺ σϑΥϧτͷઃఆϑΝΠϧ͕ެ։͞Ε·ͨ͠ɻ
2 3 ᶈ.envΛฤू ઌ΄Ͳ࡞ͨ͠ΞϓϦέʔγϣϯʹهࡌ͞Ε͍ͯΔυϝΠϯ,ID,ύε ϫʔυΛLaravelΞϓϦέʔγϣϯͷ.envʹՃ͠·͢ɻ
2 4 ᶉroutes/api.phpΛฤू
2 5 ᶊίϯτϩʔϥΛ࡞
2 6 ᶋconfig/auth.phpΛฤू ೝূํ๏ΛAuth0ʹมߋ
2 7 ᶌbladeϑΝΠϧΛฤू
WWW.SITE2MAX.PRO Free PowerPoint & KeyNote Templates 4 DEMO EC Site
EC Site https://murmuring-tor-53965.herokuapp.com/
2 9 ࣮ࡍʹಈ͔͢
3 0 ࣮ࡍʹಈ͔͢
3 1 ࣮ࡍʹಈ͔͢
3 2 ࣮ࡍʹಈ͔͢
3 3 ࣮ࡍʹಈ͔͢
3 4 ࣮ͯ͠Έͨײ ɾ࣮͕͘͢͝؆୯ʹͰ͖ͨ(2͘Β͍ͰECαΠτ͕) ɾϩάΠϯϢʔβʹΑͬͯݖݶ͚ͨΓͱ͔ɺෳࡶͳ͜ͱ Ζ͏ͱͨ࣌͠ʹগ͠େมͦ͏ɻ ɾҰɺ࣮ͯ͠͠·͑ɺSNSͷ࿈ܞઌ૿͢ͷϘλϯ Λϙνϙν͢Δ͚ͩͰOKʂ
3 5 ࢀߟ https://qiita.com/furuth/items/8826b66a3ec2b2b14222 https://dev.classmethod.jp/cloud/auth0-overview/ https://www.hypertextcandy.com/laravel-tried-auth0
3 6 ࠂ https://phpcon.okinawa.jp/ 2019/10/12()ʹԭೄͰPHPΧϯϑΝϨϯεΛ։࠵͠·͢ʂʂʂ ͥͻདྷ͍ͯͩ͘͞ʂ