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
Json Web Token at Employment Hero
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Luong Vo
September 11, 2018
Programming
0
41
Json Web Token at Employment Hero
Luong Vo
September 11, 2018
Tweet
Share
More Decks by Luong Vo
See All by Luong Vo
Why our platform needs Redis Sentinel
luongvo
0
98
Performance Monitoring at Employment Hero
luongvo
0
150
Lalaland - A C2C ecommerce site - pitch deck
luongvo
0
440
Skeleton-based Human Action Recognition with Recurrent Neural Network
luongvo
0
250
Ruby Threads
luongvo
1
34
Caching in Ruby
luongvo
1
37
Monitoring system at Employment Hero
luongvo
0
53
Introduction to Docker and Docker Compose
luongvo
0
65
Database migration from Heroku to Amazon Web Services
luongvo
0
75
Other Decks in Programming
See All in Programming
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
420
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
2.3k
Angular-Apps smarter machen mit Gen AI: Lokal und offlinefähig - Hands-on Workshop!
christianliebel
PRO
0
110
AI駆動開発の本音 〜Claude Code並列開発で見えたエンジニアの新しい役割〜
hisuzuya
4
510
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
950
AI 開発合宿を通して得た学び
niftycorp
PRO
0
120
「抽象に依存せよ」が分からなかった新卒1年目の私が Goのインターフェースと和解するまで
kurogenki
0
120
DevinとClaude Code、SREの現場で使い倒してみた件
karia
1
1.1k
Vuetify 3 → 4 何が変わった?差分と移行ポイント10分まとめ
koukimiura
0
140
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
550
モックわからないマン卒業記 ~振る舞いを起点に見直した、フロントエンドテストにおけるモックの使いどころ~
tasukuwatanabe
2
330
AI時代のソフトウェア開発でも「人が仕様を書く」から始めよう-医療IT現場での実践とこれから
koukimiura
0
150
Featured
See All Featured
Mind Mapping
helmedeiros
PRO
1
120
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.1k
How to train your dragon (web standard)
notwaldorf
97
6.6k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.1k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
110
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.8k
Ethics towards AI in product and experience design
skipperchong
2
220
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
70
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Transcript
JSON Web Tokens Luong Vo
None
None
None
None
None
None
JSON Web Token
What is JSON Web Tokens
JSON Object To transfer data between two parties digitally signed
Digitally signed JSON Data Signature JSON Web Token
Signature signing algorithm
RSA256
HSA256
Comparison RSA256 HSA256
None
None
JSON API Authentication
Main app Username + password Session token Auth Service Generate
session token Save session token to database But why?
Main app Session token JWT Token Auth Service Generate JWT
Query session token to check But why?
Main app Get/…. + JWT Token { “data”: …. }
Auth Service Validate JWT But why?
Main app Get/…. + JWT Token { “data”: …. }
Auth Service Validate JWT Microservice GRPC call But why?
Microservice API Call !? Oh….
Main app Get/…. + JWT Token { “data”: …. }
Auth Service Validate JW T Microservice Oh….
External system Main app Microservice
None
Microservice API Call Should we? Auth Service authenticate
Microservice API Call Better! LOAD BALANCER Auth Service authenticate API
Gateway
Main app Get/…. + JWT Token { “data”: …. }
Auth Service Microservice LOAD BALANCER
None
None
None
https://github.com/Thinkei/eh-kong/blob/master/auth/handler.lua#L49
None
Why not just use JWT
Size User ID in JWT User id in session token
• Require CPU to compute cryptographic signatures • No utilisation
of being stateless • Redundant-signing • Can be read on the client side • Must be explicitly encrypted if we wanted to • Hard revocation
That’s it. Thank you for your attention!