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
Luong Vo
September 11, 2018
Programming
0
40
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
93
Performance Monitoring at Employment Hero
luongvo
0
140
Lalaland - A C2C ecommerce site - pitch deck
luongvo
0
420
Skeleton-based Human Action Recognition with Recurrent Neural Network
luongvo
0
240
Ruby Threads
luongvo
1
31
Caching in Ruby
luongvo
1
33
Monitoring system at Employment Hero
luongvo
0
49
Introduction to Docker and Docker Compose
luongvo
0
64
Database migration from Heroku to Amazon Web Services
luongvo
0
69
Other Decks in Programming
See All in Programming
Kotlin 2.2が切り拓く: コンテキストパラメータで書く関数型DSLと新しい依存管理のかたち
knih
0
350
What’s Fair is FAIR: A Decentralised Future for WordPress Distribution
rmccue
0
130
SUZURIの規約違反チェックにおけるクリエイタフィードバックの試⾏錯誤/Trial and Error in Creator Feedback for SUZURI's Terms of Service Violation Checks
ae14watanabe
1
130
React Nativeならぬ"Vue Native"が実現するかも?_新世代マルチプラットフォーム開発フレームワークのLynxとLynxのVue.js対応を追ってみよう_Vue Lynx
yut0naga1_fa
2
2k
Migration to Signals, Resource API, and NgRx Signal Store
manfredsteyer
PRO
0
150
MCPサーバー「モディフィウス」で変更容易性の向上をスケールする / modifius
minodriven
6
1.2k
自動テストのアーキテクチャとその理由ー大規模ゲーム開発の場合ー
segadevtech
2
730
GitHub Copilotを使いこなせ!/mastering_github_copilot!
kotakageyama
2
840
歴史から学ぶ「Why PHP?」 PHPを書く理由を改めて理解する / Learning from History: “Why PHP?” Rediscovering the Reasons for Writing PHP
seike460
PRO
0
120
ノーコードからの脱出 -地獄のデスロード- / Escape from Base44
keisuke69
0
640
CSC509 Lecture 10
javiergs
PRO
0
170
Researchlyの開発で参考にしたデザイン
adsholoko
0
110
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
40
2.1k
A Modern Web Designer's Workflow
chriscoyier
697
190k
Designing Experiences People Love
moore
142
24k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
BBQ
matthewcrist
89
9.9k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.7k
Designing for humans not robots
tammielis
254
26k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Navigating Team Friction
lara
190
15k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
The Pragmatic Product Professional
lauravandoore
36
7k
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!