You are on page 1of 25

OAuth

Fei Hu
What is oauth?
An open protocol to allow secure API
authorization in a simple and standard method
from desktop and web applications.
Oauth is ...

• Token-based Authentication

Logged-in user has a unique token used to access data from


the site
Roles in OAuth

User

Service
Consumer
Provider
Roles in OAuth

• User - Social network user like you and me

• Consumer – application that uses OAuth to access the


resources in service provider

• Service provider - web application that allows access via


OAuth
A Typical Scenario
User

PRINTER PHOTO
How does OAuth work?
Request Token!

PRINTER site PHOTO site

asks for
request token
returns
request token

...
Authorize!

PRINTER site PHOTO site

redirects user to
PHOTO with
request token user logs in and
authorizes
PRINTER

redirect back
with authorized
request token
Access Token!

PRINTER site PHOTO site


ask for access
token with
authorized
request token
request token
exchanged for
access token

PRINTER
stores access
token
PRINTER use the access token
print protected resources(photos)
from PHOTO site
Authorization Process
• Obtain request token
• User authorize request
token
• Exchange request token
for an access token
• Use access token to obtain
protected resources

picuture from http://www.oauth.net


Tokens

• Request Tokens

• Access Tokens
Who is using Oauth?
library

http://oauth.net/code/
Client to Twitter: An OAuth example
register your application

• http://twitter.com/oauth_clients
register your application
Twitter4J
Output
Twitter
Twitter
Twitter
Thank you
Question?
•Oauth is ____based authentication
token
•Three Roles in OAuth
User, Consumer, and Service provider
Consumer uses ___ key to access protected resource
A.Request

B.Access

C.Comsuer

You might also like