Wednesday, 1 May 2013

OAuth “dance” - server side flow

Getting some inspiration from this dialog about OAuth 1.0 I thought it would be nice to have something similar for OAuth 2.0


The Actors

 

The R.O. shows intent

Alice (R.O.): hey, Bob , I would like you to be able to access the profile pictures from my Facebook account so you can print for me a nice photo album.
Bob (client): no problem, I know how we can do it. All I need is you getting me an Authorization Code from Facebook.

The R.O. obtain an authorization code


Alice (R.O.): hey Mark, www.printondemand.biz wants an Authorization Code
Mark (server):
are you sure you want to give this code to www.printondemand.biz?
this will allow it to get all profile pictures from your profile.
Alice (R.O.):
yes it is ok.
Mark (server): ok I am sending you over to www.printondemand.biz

The R.O. is redirected to the client

Alice (R.O.): hey Bob here we go, this is the Authorization Code
Bob (client): thanks

The client exchange the Authorization Code for an
Access Token

Bob (client): hey Mark, I would like to trade my Authorization Code for an Access Token
Mark (server): hey Bob here we go

The client access the protected resource

Bob (client): hey Mark, give me the profile pictures, here is the
Access Token
Mark (server): here you are


No comments: