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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Matthew Rudy Jacobs
January 15, 2014
Technology
860
6
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
More Decks by Matthew Rudy Jacobs
See All by Matthew Rudy Jacobs
From Developer to Architect (and back again)
matthewrudy
3
250
Humans are Hard
matthewrudy
0
160
[Alpha] Humans Are Hard
matthewrudy
0
130
From Developer To Architect
matthewrudy
0
120
Git Commit Signing: Code we can trust?
matthewrudy
0
200
We Need To Talk About Postgres
matthewrudy
0
110
Coding as a Team At GoGoVan
matthewrudy
3
470
10 Years of Code
matthewrudy
0
140
Elixir - Part 1
matthewrudy
1
220
Other Decks in Technology
See All in Technology
ソフトウェアサプライチェーンの構造的リスクとコンテナ環境の保護
kyohmizu
4
410
Master Dataグループ紹介資料
sansan33
PRO
1
4.8k
Bill One 開発エンジニア 紹介資料
sansan33
PRO
7
20k
LLM・AIエージェントシステムベストプラクティス
shibuiwilliam
6
1.5k
My broken English still works: speaking at global OSS events
naruoga
0
110
Service Connect 上のサービスに ECS Service の外側から到達できなかった話
ota1022
1
270
Invisible to AI? Making TYPO3 Sites Quotable by AI Search Systems
wolfgangwagner
0
220
老害フォレンジッカーはAI羊の夢を見るか?
tadmaddad
0
350
AIのためのEthernet技術動向 (SerDes)
markunet
1
210
ハーレムエンジニアリング
kazuma777777
0
180
攻撃と防御で学ぶAI時代のプロダクトセキュリティ演習
recruitengineers
PRO
9
3.1k
[ChatGPT Work LT]事務作業が苦手な人のための バックオフィスの「半」自動化
chimaki_iot
0
320
Featured
See All Featured
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.8k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.3k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.5k
A Tale of Four Properties
chriscoyier
163
24k
So, you think you're a good person
axbom
PRO
2
2.1k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
800
Exploring anti-patterns in Rails
aemeredith
3
470
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
BBQ
matthewcrist
89
10k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
470
The Cost Of JavaScript in 2023
addyosmani
55
10k
Visualization
eitanlees
152
17k
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