Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Facebook Login Security
Search
Kien Nguyen
November 01, 2017
Programming
67
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Facebook Login Security
Kien Nguyen
November 01, 2017
More Decks by Kien Nguyen
See All by Kien Nguyen
Introduction
kiennt
0
71
Introduction to Django v2
kiennt
0
130
Clean code
kiennt
8
430
Introduction to Django
kiennt
0
130
Unix_Process.pdf
kiennt
2
8.3k
Happiness
kiennt
1
490
RTMP and RTMPE protocols
kiennt
2
690
Other Decks in Programming
See All in Programming
AWSに止められる覚悟してますか?
morizo_1984
2
530
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
170
コードで差別化できない時代の ソフトウェアエンジニアリング / Software Engineering in an Era Where Code Doesn’t Differentiate
kishida
2
180
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
2
630
SREの越境 / SRE Collaboration
y0hgi
2
310
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.6k
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
380
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
140
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
35
17k
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
150
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
120
ジョジョの世界をXRで再現する
mofurune
0
160
Featured
See All Featured
Context Engineering - Making Every Token Count
addyosmani
9
1.2k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
Building AI with AI
inesmontani
PRO
1
1.3k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
570
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
360
Art, The Web, and Tiny UX
lynnandtonic
304
22k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
630
KATA
mclloyd
PRO
35
16k
Amusing Abliteration
ianozsvald
1
350
SEO for Brand Visibility & Recognition
aleyda
0
4.8k
Transcript
Securing Login With Facebook API for Mobile Application
kiennt.com Kien Nguyen Lead Backend Engineer github.com/kiennt
Why I choose this topic
I hacked
Facebook Login Flow
Facebook Login Flow
Use client to get facebook data graph.facebook.com/me fb access token
1
Use client to get facebook data graph.facebook.com/me fb access token
1 user ’s facebook id 2
Use client to get facebook data graph.facebook.com/me fb access token
1 user ’s facebook id 2 facebook_id 3 your server
Use client to get facebook data graph.facebook.com/me fb access token
1 user ’s facebook id 2 facebook_id 3 your server your database get or insert base on facebook_id 4
Use client to get facebook data graph.facebook.com/me fb access token
1 user ’s facebook id 2 facebook_id 3 your server your database site access token 5 5 get or insert base on facebook_id 4
fake facebook_id 3 your server your database site access token
5 5 get or insert base on facebook_id 4 attacker Attacker only need to know facebook_id
Never trust data from client!
Use server to get facebook data your server fb access
token 1
Use server to get facebook data your server fb access
token 1 get user data 2
Use server to get facebook data your server fb access
token 1 graph.facebook.com/me get user data 2 user facebook_id 3
Use server to get facebook data your server fb access
token 1 graph.facebook.com/me your database get user data 2 user facebook_id 3 get or insert 4
Use server to get facebook data your server fb access
token 1 graph.facebook.com/me your database site access token 5 5 get user data 2 user facebook_id 3 get or insert 4
Attacker use fake access token your server fake access token
1 graph.facebook.com/me your database site access token 5 5 get user data 2 user facebook_id 3 get or insert 4 attacker
Attacker use fake access token your server fake access token
1 graph.facebook.com/me your database site access token 5 5 get user data 2 user facebook_id 3 get or insert 4 attacker other fb application a valid facebook token
Always validate client data
How to fix? your server fb access token 1 graph.facebook.com/me
your database site access token 5 6 get user data 3 user facebook_id 4 get or insert 5 graph.facebook.com validate fb access token 2
How to fix? https://developers.facebook.com/docs/facebook-login/access-tokens/debugging-and-error-handling GET /debug_token?input_token={input-token}&access_token={access-token}
Conclusion Do not use client to get facebook user data
Use /debug_token to check access token is from your application
Remember Do not use client to get facebook user data
Use /debug_token to check access token is from your application TRUST CIRCLE IS HIRING
None