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
Ember and OAuth
Search
Matthew Rudy Jacobs
January 15, 2014
Technology
6
840
Ember and OAuth
A brief tour of OAuth2 and it's use with Ember and other Client-side frameworks
Matthew Rudy Jacobs
January 15, 2014
Tweet
Share
More Decks by Matthew Rudy Jacobs
See All by Matthew Rudy Jacobs
From Developer to Architect (and back again)
matthewrudy
3
220
Humans are Hard
matthewrudy
0
130
[Alpha] Humans Are Hard
matthewrudy
0
90
From Developer To Architect
matthewrudy
0
70
Git Commit Signing: Code we can trust?
matthewrudy
0
170
We Need To Talk About Postgres
matthewrudy
0
83
Coding as a Team At GoGoVan
matthewrudy
3
420
10 Years of Code
matthewrudy
0
100
Elixir - Part 1
matthewrudy
1
180
Other Decks in Technology
See All in Technology
Microsoft の SSE の現在地
skmkzyk
0
300
PagerDuty×ポストモーテムで築く障害対応文化/Building a culture of incident response with PagerDuty and postmortems
aeonpeople
3
550
クラウドネイティブ環境の脅威モデリング
kyohmizu
1
360
kernelvm-brain-net
raspython3
0
310
勝手に!深堀り!Cloud Run worker pools / Deep dive Cloud Run worker pools
iselegant
4
650
Databricksで完全履修!オールインワンレイクハウスは実在した!
akuwano
0
150
genspark_presentation.pdf
haruki_uiru
1
190
AIにおけるソフトウェアテスト_ver1.00
fumisuke
1
360
Datadog のトライアルを成功に導く技術 / Techniques for a successful Datadog trial
nulabinc
PRO
0
110
Aspire をカスタマイズしよう & Aspire 9.2
nenonaninu
0
380
Compose におけるパスワード自動入力とパスワード保存
tonionagauzzi
0
200
Part1 GitHubってなんだろう?その2
tomokusaba
1
490
Featured
See All Featured
Making Projects Easy
brettharned
116
6.2k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.2k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
34
2.2k
Build The Right Thing And Hit Your Dates
maggiecrowley
35
2.7k
Six Lessons from altMBA
skipperchong
28
3.8k
Typedesign – Prime Four
hannesfritz
41
2.6k
A Tale of Four Properties
chriscoyier
159
23k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.2k
A designer walks into a library…
pauljervisheath
205
24k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.3k
Documentation Writing (for coders)
carmenintech
71
4.8k
Transcript
Ember & OAuth Matthew Rudy Jacobs Wednesday 15th January 2014
@ EmberLondon
@matthewrudy
cronycle.com
The Goal
Authenticate via a 3rd party
Obtain access to a 3rd party API
The Tool
OAuth2 http://tools.ietf.org/html/rfc6749
“The Road to Hell”?
Actually it’s alright
4 Different Flows otherwise known as “grant types”
4 Grant Types • Authorization Code • Implicit • Resource
Owner Password Credentials • Client Credentials
Authorization Code
Authorization Code
Authorization Code auth code access token /auth?code=abc123
Implicit
Implicit S3
Implicit S3 access token /auth#access_token=abc123
Password
Password
Password access token { access_token: “abc123” }
Client Credentials
Client Credentials
Implicit Grant Flow this is what we want!
ember-oauth2
None
Initiate the Auth
Sign in with Github
We have a token
Except we don’t!
This is not Implicit!
This is not Implicit! /callback?code=…
This is not Implicit! /callback?code=… /callback#access_token=…
Github doesn’t do Implicit Grant!
Github suggests you use passwords
TLDR; pure client-side OAuth is poorly supported
But what about a hybrid approach?
Authorization Code Flow (as an API) ❤️
Stick Ember in the middle
The Concept
GET /oauths/new {url: “https://github.com/auth?…”} https://github.com/auth?…
GET /oauths/new {url: “https://github.com/auth?…”} https://github.com/auth?… callback POST /oauths {access_token: “abc123”}
GET /oauths/new {url: “https://github.com/auth?…”} https://github.com/auth?… callback POST /oauths {access_token: “abc123”}
Hack it together!
OAuth API Client
Handled in a Route
Easy right?
Thanks
@matthewrudy