OAuth & OpenID for Data Access and Identity in Web Apps Ryan Boyd http://profiles.google.com/ryan.boyd @ryguyrg

Agenda 1

Concepts & Terminology

2

Authorization with OAuth 2.0

3

Authentication with OpenID Connect

4

User Experience

5

Google Identity Toolkit

6

Resources, Q&A

Concepts & Terminology

Authentication

Authorization

Delegation

Authentication & Authorization on the Web

Quick Poll

Do you use the same username & password for multiple web sites? Yes!

Quick Poll

How many keystrokes do you type to sign up for a new account? 50+!

Quick Poll

Have you ever shared a password so another app can access your data? Yes!

Challenges How can we: 1) minimize the number of accounts and passwords users need to remember? 2) discourage password reuse? 3) optimize sign-up flows to onboard users faster?

OpenID Connect

Challenges How can we: 1) eliminate the need to reveal passwords to share data with 3rd-party applications? 2) restrict the level of data available to 3rd-party applications?

OAuth 2.0

OAuth 2.0

35+ APIs

Example OAuth-enabled APIs

Contacts

Calendar

Picasa Web Albums

YouTube

Demo https://tasks-sample-app.appspot.com/

OAuth 2.0 - What’s new? ✓ Defined flows for different environments ✓ Improved user & developer experience ✓ Short lived, refreshable bearer tokens ✓ Avoids complex cryptography ✓ Leverages SSL/HTTPS

Tokens & Codes Access Token - Short lived credential for accessing protected resources. Authorization Code - Intermediate token representing an authorization grant, redeemable for access & refresh tokens Refresh token - Long lived token, redeemable for access tokens

SaaSy Payroll

SaaSy Payroll

SaaSy Payroll

OAuth 2.0: Roles Client o Web application o Needs access to the protected resource

Resource Server o Holds the protected resource

Protected Resource o Resides on server o Requires authorization

Authorization Server o Issues Access Tokens

Resource Owner o Owns protected resource o Approves access

Client Registration Developer registers application with resource/authorization server, gets a client_id and client_secret

OAuth 2.0 - Flows

Flows supported by Google • Implicit flow for Client-side Web Applications • Authorization code flow for Server-side Web Applications • Device flow for apps on devices with limited input

OAuth 2.0 - User Agent Flow (Implicit Grant)

When to use • Apps residing on client device - web mashups, mobile, desktop apps where embedding client keys & secrets is not secure • When you only require temporary or one-time access to the protected resource

Requesting Authorization 1

Application redirects user to Google, specifying: client_id obtained during registration redirect_uri for user to return to scope or APIs the app needs access to. response_type value of token requests an implicit grant.

Obtaining Access Tokens 2

Google redirects the user back to the application’s redirect_uri and includes an access_token in the URL fragment ID. http://www.saasyapp.com/payroll/ back#access_token=&token_type=bearer&expire s_in=3600

3

Application extracts access token from URL fragment ID (JavaScript). var data = {}; window.location.hash.replace( new RegExp("([^#=&]+)(=([^&]*))?", "g"), function($0, $1, $2, $3) { data[decodeURI($1)] = decodeURI($3); }); access_token = data["access_token"];

X

Calling an OAuth 2.0 Protected API 4

Application makes a HTTP GET or HTTP POST request to the server containing the protected resource, including the access_token as a query param or header. Query-param (e.g. JSON-P with

Server Integration /** * Returns the account info for an email, or null if not registered. * The email and accountType fields must be set in returned Account */ Account getAccountByEmail(String email) { // To be implemented by RP. } /** * Returns whether the password is valid for the user. */ boolean checkPassword(String email, String password) { // To be implemented by RP. } /** * Upgrade a legacy email account to federated login. * The response code may be OK, ACCOUNT_NOT_FOUND, * ACTION_NOT_ALLOWED, UNKNOWN_ERROR. */ ResponseCode toFederated(String email){ // To be implemented by RP. Normally just update the user-account DB }

GITKit Benefits ✓ Pre-built Account Chooser UI ✓ Same infrastructure Google uses ✓ Hides most of the complexity around adopting federated identity ✓ Supports legacy users, upgrade to federated login ✓ Libraries available for Java, PHP

Mobile Use Cases

Authentication 1

2

Embed a web browser & use OpenID: Android: WebView iOS: UIWebView Issue a proprietary token to your app: Similar to a session token

3

Extract the token: Android: CookieManager iOS: NSHttpCookieManager All: window title

4

Call your APIs, passing the token

Authorization 1

2

3

Embed a web browser & use OAuth: Android: WebView iOS: UIWebView Get an OAuth 2.0 access_token for your app, using either the implicit flow or native app flow: Implicit: use JavaScript hosted by your web server Native: specify redirect_uri of urn:ietf:wg:oauth:2.0:oob

Call Google’s APIs, passing the access_token

Authorization - Android & Tasks 1

2

3

Use the GoogleAccountManager and request a token of type Manage Your Tasks After the user approves access, your app will get an OAuth 2.0 access_token

Call Google’s APIs, passing the access_token

Summary

Summary • Developers have an obligation to help users stay safe, use good password practices • Leveraging standards like OAuth 2.0 and OpenID Connect helps • OAuth 2.0 for securely accessing user data – Industry standard nearing finalization – Well defined flows for different use cases – Simplified protocol, avoids many of the pitfalls in previous attempts • OpenID Connect for federated login – Builds on OAuth 2.0 – Account Chooser or GITKit for great UX!

Resources, Q&A and Feedback Google’s AuthNZ docs - http://code.google.com/apis/accounts/ OAuth 2.0 - http://oauth.net/2/ OAuth 2.0 playground - https://code.google.com/oauthplayground/ Google Identity Toolkit - http://code.google.com/apis/identitytoolkit/ Account Chooser - http://accountchooser.com OpenID Connect - http://openid.net/connect/

@ryguyrg

http://profiles.google.com/ ryan.boyd

OAuth 2.0 and OpenID Connect - GDD Tel Aviv 2011 - Ryan Boyd ...

OAuth 2.0 and OpenID Connect - GDD Tel Aviv 2011 - Ryan Boyd - including skipped slides.pdf. OAuth 2.0 and OpenID Connect - GDD Tel Aviv 2011 - Ryan ...

6MB Sizes 2 Downloads 128 Views

Recommend Documents

OAuth 2.0 and OpenID Connect - GDD Tel Aviv 2011 - Ryan Boyd ...
OAuth 2.0 and OpenID Connect - GDD Tel Aviv 2011 - Ryan Boyd - including skipped slides.pdf. OAuth 2.0 and OpenID Connect - GDD Tel Aviv 2011 - Ryan ...

Tel Aviv State - A Threat to Israel
How is the accelerated development of Tel Aviv to be slowed? 61 ... Figure 5: Students at institutions of higher learning (first and second degrees) 39 in the field of design ...... concentrated in it, about 60% of academics and scientists, about 90%

The Tel Aviv STAr -
Dec 1, 2011 - Auto Sales . ... coordinating with the school, registering the vendors, marketing the event .... Family Member Training: [email protected] ..... Specialties also include: Plaster, paint, electric, plumbing, parquet,.

The Tel Aviv STAr -
Dec 1, 2011 - Auto Sales . ... coordinating with the school, registering the vendors, marketing the event ..... Great family car for the city - seats 6 (3 plus 3). .... of construction) Specialties also include: Plaster, paint, electric, plumbing, pa

Stealing Success Tel Aviv Style - If Americans Knew
government contracts just as if they were US companies. ing letters and ... payer subsidized development of Israeli enterprises combined with the free access to the ... craft communications, software systems, and advanced materials and coat-.

the greater tel-aviv area cryptography symposium ... -
Mar 9, 2016 - INVITED SPEAKERS: BENNY APPLEBAUM,NIMROD AVIRAM,. ZVIKA BRAKERSKI,NIV GILBOA,URI STEMMER. ORGANIZER:ADI AKAVIA.

Map DLD Tel Aviv Spring Urban Experience.pdf
Page 1 of 2 .st am'Ha Ahad .st Yavne .st Yavne .st Mazeh .st Allenby .st Allenby .st Lilienblum .st Sinai Har .Blvd Rothschild @ Experience Urban Spring 2014 ...

Clang GDD - GitHub
Università degli Studi di Milano - OGD – aa 2015-16. 1. Summary. Brave Kids Team . ..... Master's Degree in Computer Science .... ranging from 7 to 35 years. Despite our target ...... For the others, please check the PDF file in attachment.

Boyd Ranch Brochure.pdf
... grass and nesting/bedding cover for wildlife. Subject to sale, withdrawal, or error. Whoops! There was a problem loading this page. Boyd Ranch Brochure.pdf.

Email | [email protected]
Apr 20, 2017 - feedback collated from students, combining good practice within the University of Sheffield and across the UK Higher. Education sector.

wonderful tonight pattie boyd pdf
wonderful tonight pattie boyd pdf. wonderful tonight pattie boyd pdf. Open. Extract. Open with. Sign In. Main menu. Displaying wonderful tonight pattie boyd pdf.

boyd convex optimization pdf
Download. Connect more apps... Try one of the apps below to open or edit this item. boyd convex optimization pdf. boyd convex optimization pdf. Open. Extract.

Keith Lohse, PhD , Lara Boyd, PT PhD , and ...
R package version 2.5. http://CRAN.R-project.org/package=wordcloud. 3. Meyer, D., Hornik, K., & Feinerer, I. (2008). Text Mining Infrastructure in R. Journal of Statistical Software, 25(5): 1-54. URL: http://www.jstatsoft.org/v25/i05/. 4. R Core Team

HYDERABAD NOTIFICATION NO. 20/2011, Dt - Appsc - Andhra ...
Dec 22, 2011 - 01/02/2012 is the last date for payment of fee) for recruitment to the .... A candidate shall be disqualified for appointment, if he himself or through.

Lettre n°20 juillet-aout 2011.pdf
Hangar auvent type Caquot, Bron, 1931. Hangar béton de 1927 (Ingénieur Le Marec). Alvéole Allemande. photos :Guilhem Labeeuw, membre 2A. Page 2 of 16 ...

LPP Focus Fusion Report September 20, 2011 - Alternative Energy
May 14, 2013 - 2. 0. -s hot m ovin. g a v e ra ge (J. ) Shot number, relative to last 100 shots ... Figure 2. First ICCD image looking up at end of anode, taken 2 ns ...

Tuesday, September 20, 2011 LUNCHES Rockford College Claire ...
Rockford College. Claire (815) 226-3384 ... Midwest College of Cosmetology. Allison Janesky (309) 533-5038 ... Morrison Institute of Technology. A.J. Danielson ...

HYDERABAD NOTIFICATION NO. 20/2011, Dt - Appsc - Andhra ...
Dec 22, 2011 - WEBSITE and enter the Journal Number to get the format of Application. ...... Design for static and dynamic loading fatigue strength stress ...

May 9, 2014 Via Electronic Mail ([email protected]) Ryan ...
Via Electronic Mail ([email protected]). Ryan Bagwell. 5219 Shorecrest Drive ... Agency Open Records Officer. (717) 787-5380. (717) 772-2317 (fax).