The Present Future of OAuth

76
OAUTH

description

An exploration into the past, present and future of the OAuth protocol.

Transcript of The Present Future of OAuth

Page 1: The Present Future of OAuth

OAUTH

Page 2: The Present Future of OAuth

OAUTHTHE PRESENTFUTURE OF

with drawings

MICHAEL BLEIGH PRESENTS

Page 3: The Present Future of OAuth

PROLOGUE

Page 4: The Present Future of OAuth

MICHAELB L E I G H

MY NAME IS

Page 5: The Present Future of OAuth

INTRIDEAI WORK AT

Page 6: The Present Future of OAuth

@MBLEIGHON TWITTER

Page 7: The Present Future of OAuth

“HEY, WOULD ANYONEBE INTERESTED IN

GIVING A TALK ABOUT OAUTH AT RAILSCONF?”

Page 8: The Present Future of OAuth

“NO WAY, I MIGHT

FALL ASLEEPWHILE SPEAKING”

Page 9: The Present Future of OAuth

“HMM...I’D BETTERADD SOME DRAWINGS.”

Page 10: The Present Future of OAuth

THIS TALKIS ABOUT OPEN WEBSTANDARDS

Page 11: The Present Future of OAuth

ACT IIN WHICH THE PROBLEM IS D E S C R I B E D

Page 12: The Present Future of OAuth

IN THE BEGINNING,THERE WERE

WEB APPS

Page 13: The Present Future of OAuth

WEBAPP

Page 14: The Present Future of OAuth

WEBAPP

Page 15: The Present Future of OAuth

WEBAPP A

WEBAPP B

Page 16: The Present Future of OAuth

WEBAPP B

“HEY, MY USERS WANT TO ACCESS YOUR STUFF.”

WEBAPP A

Page 17: The Present Future of OAuth

WEBAPP B

WEBAPP A

+API

Page 18: The Present Future of OAuth

HTTPBASIC

Page 20: The Present Future of OAuth

WEBAPP B

WEBAPP A

+API

OK, HERE’S THE KEYS.

Page 21: The Present Future of OAuth

WEBAPP B

WEBAPP A

+API

Page 22: The Present Future of OAuth

WEBAPP B

WEBAPP A

+API

Page 23: The Present Future of OAuth

FUBARFAILED USER BAR FORAUTHORIZATION ROBUSTNESS

*COUGH*

Page 24: The Present Future of OAuth

THIS ISA PROBLEM

Page 25: The Present Future of OAuth

ACT 2IN WHICH A N E W W AYIS CREATED

Page 26: The Present Future of OAuth

CHRIS MESSINABLAINE COOKLARRY HALFF

DAVID RECORDON

Page 27: The Present Future of OAuth

“HEY, WOULDN’T IT BE GREAT TO HAVE AN OPEN AUTHORIZATION

STANDARD”

Page 28: The Present Future of OAuth

“TOTALLY, LET’SMAKE ONE ANDCALL IT OAUTH.”

Page 29: The Present Future of OAuth

FOOTAGEMISSING

Page 30: The Present Future of OAuth

WEBAPP B

WEBAPP A

Page 31: The Present Future of OAuth

WEBAPP B

WEBAPP A

Page 32: The Present Future of OAuth

WEBAPP B

WEBAPP A

“HEY, MY USER WANTS TO ACCESS YOUR STUFF.”

Page 33: The Present Future of OAuth

WEBAPP B

WEBAPP A

Page 34: The Present Future of OAuth

WEBAPP B

WEBAPP A

Page 35: The Present Future of OAuth

WEBAPP B

WEBAPP A

“WHAT’S YOUR PASSWORD?”

“PASSWORD”

Page 36: The Present Future of OAuth
Page 37: The Present Future of OAuth

WEBAPP B

WEBAPP A

Page 38: The Present Future of OAuth

WEBAPP B

WEBAPP A

Page 39: The Present Future of OAuth

ADVANTAGES

Page 40: The Present Future of OAuth

1. SECURE

Page 41: The Present Future of OAuth

2. RESTRICTABLE

WEBAPP B

WEBAPP A

“UMMM....NO”

“DELETE ALLUSER DATA”

Page 42: The Present Future of OAuth

3. REVOCABLE

WEBAPP B

*YOIN

K*

Page 43: The Present Future of OAuth

3. STANDARD

WEBAPP A

WEBAPP C

WEBAPP D

WEBAPP E

WEBAPP F

Page 44: The Present Future of OAuth

NOT QUITEPERFECT

Page 45: The Present Future of OAuth

1. COMPLICATED

WEBAPP B

WEBAPP A “NO NO, FIRST

YOU REVERSELOW FIVE...”

“OK, SO IT’S FIST BUMP,DOUBLE-HIGH FIVE...”

Page 46: The Present Future of OAuth

2. BROWSER-DEPENDENT

?

Page 47: The Present Future of OAuth

2. BROWSER-DEPENDENT

Page 48: The Present Future of OAuth

WE CAN DO BETTER

Page 49: The Present Future of OAuth

ACT 3IN WHICH WELEARN FROMOUR MISTAKES

Page 50: The Present Future of OAuth
Page 51: The Present Future of OAuth
Page 52: The Present Future of OAuth

OAUTH2.0

Page 53: The Present Future of OAuth

IMPROVEM E N T S

Page 54: The Present Future of OAuth

1. SIMPLER

WEBAPP B

WEBAPP A

< SSL >

Page 55: The Present Future of OAuth

2. FLOWS

Page 56: The Present Future of OAuth

WEBAPP B

WEBAPP A

WEB SERVER

Page 57: The Present Future of OAuth

WEBAPP A

USER-AGENT

Page 58: The Present Future of OAuth

WEBAPP A

DEVICE

SET-­TOPPER

Page 59: The Present Future of OAuth

WEBAPP A

PASSWORD

Page 60: The Present Future of OAuth

WEBAPP A

PASSWORD

Page 61: The Present Future of OAuth

WEBAPP A

PASSWORD

Page 62: The Present Future of OAuth

WEBAPP A

PASSWORD

Page 63: The Present Future of OAuth

WEBAPP A

PASSWORD

Page 64: The Present Future of OAuth

WEBAPP B

WEBAPP A

CLIENT CREDENTIALS

Page 65: The Present Future of OAuth

WEBAPP B

WEBAPP A

ASSERTION

CERTIFICATE OFAUTHENTICITY

Page 66: The Present Future of OAuth

FLEX-IBILITY

Page 67: The Present Future of OAuth

ACT 4IN WHICH WEGET DOWN TOB U S I N E S S

Page 68: The Present Future of OAuth

WHO’S DOING IT RIGHT NOW?

Page 69: The Present Future of OAuth

WHO WILL BEDOING IT SOON?

Page 70: The Present Future of OAuth

WHO WILL BEDOING IT SOON?

YOU

Page 71: The Present Future of OAuth

CONSUMINGOAUTH 2.0

Page 72: The Present Future of OAuth

# in Gemfilegem 'oauth2'

$ rails g controller oauth

# in routes.rbresource :oauth, :controller => 'oauth' do get :start get :callbackend

Page 73: The Present Future of OAuth

class OauthController < ApplicationController def start redirect_to client.web_server.authorize_url( :redirect_uri => callback_oauth_url(:format => 'json'), :scope => 'user' ) end

def callback access_token = client.web_server.get_access_token( params[:code], :redirect_uri => callback_oauth_url(:format => 'json') )

# you should store the access token info now. render :json => access_token.get('/api/v2/json/user/show') end

protected

def client @client ||= OAuth2::Client.new( '296e901b0e6ab74db167', '625fe65c7f74ee4a015d121efb011a45776d510d', :site => 'https://github.com', :authorize_path => '/login/oauth/authorize', :access_token_path => '/login/oauth/access_token' ) endend

Page 74: The Present Future of OAuth

PROVIDINGOAUTH 2.0

Page 75: The Present Future of OAuth

READ THE

SPEChttp://bit.ly/oauth2-spec

Page 76: The Present Future of OAuth

READ THE

SPEChttp://bit.ly/oauth2-spec

NO SERIOUSLY,