OAuth Overview

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

1 comments

Comments 1 - 1 of 1 previous next Post a comment

  • + rabble Rabble . 7 months ago
    I’m sorry but you’re wrong. OAuth is about Authorization and NOT Authentication. It’s OpenID which is focused on Authentication.
Post a comment
Embed Video
Edit your comment Cancel

4 Favorites

OAuth Overview - Presentation Transcript

  1. OAuth a not-so-basic introduction zach graves zachg@yahoo-inc.com twitter: basictheory
  2. What Is OAuth? A simple, open standard for secure API authentication. -or- An open protocol to allow secure API authorization in a simple and standard method from desktop and web applications.
  3. Why OAuth? Too many different authentication protocols across the internet.
  4. OAuth is similar to... • Flickr Auth • Yahoo BBAuth • Google AuthSub • Facebook Auth • and more... for an open standard) (hence the need
  5. OAuth is... • API Authentication services requiring basic auth. Provides access to various • Token-basedhas a unique token given to an app to Logged-in user API Authentication fetch data from the site, with permission.
  6. Who is involved? • Flickr & Yahoo! • Twitter • Google • Digg • Pownce • Google / Orkut
  7. Goals of OAuth • Be Open, Secure & Flexible • Maintain consistency for developers. • Make authentication easy for your users to understand and use.
  8. Typical OAuth flow
  9. Need to Login
  10. Login with service provider
  11. User Authorizes application
  12. Done
  13. How does it work for developers? • Provide service provider details about your application (owner, url, name) • Service provider assigns your app an id, consumer key and consumer secret. • Service provides OAuth endpoints.
  14. OAuth Process 1. Obtain request token (get_request_token) 2. User login and authorizes request token (request_auth) 3. Exchange request token for an access token. (get_token) 4. Use access token to request protected resources. (Renew after expiry with get_token)
  15. OAuth Parameters • oauth_consumer_key - (provided by service provider) • oauth_token - (user access token) • oauth_timestamp - (The CURRENT timestamp) • oauth_nonce - (a random string) • oauth_signature_method - (the signature method, hmac- sha1 or plaintext) • oauth_signature - (encrypted string of url + all parameters)
  16. Passing the OAuth info • Authorization Header • HTTP POST request body • URL query string
  17. How this is secure • No username or password transmitted to or from the consumer application • Timestamp and nonce are unique to prevent replay attacks • Encrypted signature helps the server verify the integrity of the data and recognize the application • Signature method - HMAC-SHA1, RSA-SHA1, Plaintext (for transmission over SSL.
  18. How this is insecure • Client applications need consumer secret embedded in the code. (javascript, flash, java, silverlight, desktop, etc.) • Compromises the consumer secret key. (it is meant to stay a secret)
  19. This is a lot of work.
  20. OAuth code • Because OAuth is an open spec, open-source libraries exist for many platforms. Java, PHP, C, C#, Javascript, .NET, Objective-C, Perl, Python, Ruby, ActionScript 3, Coldfusion, OCaml, Jifty, Maven... To name a few. • http://code.google.com/p/oauth/ • http://oauth.net/code
  21. Yahoo SDK • We have a PHP SDK for easily making signed OAuth requests to Yahoo! Social APIs. http://developer.yahoo.com/social/sdk
  22. Two legged OAuth Allows access to resources that don’t require user auth $consumerKey = “ABCDEFG1234”; $consumerSecret = “TUVWXYZ5678”; $baseUrl = “http://myapp.com/services/getStats”; $args = array(‘format’=>‘json’); $consumer = new OAuthConsumer($consumerKey, $consumerSecret); // no access token, pass NULL. $request = OAuthRequest::from_consumer_and_token($consumer, NULL, \"GET\", $base, $args); $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $consumer, NULL); $requestUrl = $url.http_build_query($args); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $requestUrl); curl_setopt($ch, CURLOPT_HTTPHEADER, array($request->to_header())); ...
  23. Use this method for services like YQL
  24. Signing requests tousing HMAC-SHA1 Yahoo! POST /oauth/v2/get_request_token HTTP/1.1 Host: api.login.yahoo.com Accept: */* Content-Length: 282 Content-Type: application/x-www-form-urlencoded URL: https://api.login.yahoo.com/oauth/v2/get_request_token? oauth_consumer_key=dj0yJmk9YmxIan[....] &oauth_signature_method=HMAC-SHA1 &oauth_version=1.0 &oauth_timestamp=1221089876 &oauth_nonce=JsZywH &oauth_signature=PnW34DmC0kPTYYD4lNPVbY3%2BF5A%3D
  25. Finally • http://oauth.net/ • http://developer.yahoo.com/oauth/ • http://code.google.com/p/oauth/

+ basictheorybasictheory, 2 years ago

custom

2298 views, 4 favs, 3 embeds more stats

An overview of OAuth w/ Yahoo! APIs

More info about this document

© All Rights Reserved

Go to text version

  • Total Views 2298
    • 2285 on SlideShare
    • 13 from embeds
  • Comments 1
  • Favorites 4
  • Downloads 41
Most viewed embeds
  • 10 views on https://inside.bluekiwi.net
  • 2 views on http://brhackday.pbwiki.com
  • 1 views on http://brhackday.pbworks.com

more

All embeds
  • 10 views on https://inside.bluekiwi.net
  • 2 views on http://brhackday.pbwiki.com
  • 1 views on http://brhackday.pbworks.com

less

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel
File a copyright complaint
Having problems? Go to our helpdesk?

Categories