SlideShare a Scribd company logo
1 of 54
Download to read offline
The Current State
of OAuth 2
Aaron Parecki • @aaronpk
Open Source Bridge • Portland, June 2011
A Brief History


aaron.pk/oauth2               @aaronpk
Before OAuth
   aka the Dark Ages

    If a third party wanted access to an account,
    you’d give them your password.
aaron.pk/oauth2                                     @aaronpk
Before OAuth 1.0
   Many sites implemented things similar to OAuth 1.0,
   with slight differences between them.



   ¡  Flickr: “FlickrAuth” frobs and tokens

   ¡  Google: “AuthSub”

   ¡  Facebook: requests signed with MD5 hashes




aaron.pk/oauth2                                          @aaronpk
OAuth 1.0




aaron.pk/oauth2   @aaronpk
OAuth 1.0 Signatures
   The signature base string is often the most difficult part of
   OAuth for newcomers to construct. The signature base string
   is composed of the HTTP method being used, followed by
   an ampersand ("&") and then the URL-encoded base URL
   being accessed, complete with path (but not query
   parameters), followed by an ampersand ("&"). Then, you
   take all query parameters and POST body parameters
   (when the POST body is of the URL-encoded type, otherwise
   the POST body is ignored), including the OAuth parameters
   necessary for negotiation with the request at hand, and sort
   them in lexicographical order by first parameter name and
                                        oauth_nonce="QP70eNmVz8jvdPevU3oJD2AfF7R7o
   then parameter value (for duplicate parameters), all the
   while ensuring that both the key and the value for oauth_callback="http%3A%2F
                                        dC2XJcn4XlZJqk", each
                                        %2Flocalhost%3A3005%2Fthe_dance
   parameter are URL encoded in isolation. Instead of using the
                                        %2Fprocess_callback%3Fservice_provider_id
   equals ("=") sign to mark the key/value relationship, you use
   the URL-encoded form of "%3D". Each parameter is then
                                        %3D11", oauth_signature_method="HMAC-SHA1",
   joined by the URL-escaped ampersand sign, "%26".
                                        oauth_timestamp="1272323042",
                                       oauth_consumer_key="GDdmIQH6jhtmLUypg82g",
                                       oauth_signature="8wUi7m5HFQy76nowoCThusfgB
                                       %2BQ%3D", oauth_version="1.0"
aaron.pk/oauth2                                                                @aaronpk
OAuth 2:
                  signatures replaced by https




        HMAC

aaron.pk/oauth2                             @aaronpk
Some Current Implementers
Facebook’s OAuth Flow




Source: https://developers.facebook.com/docs/authentication/   @aaronpk
aaron.pk/oauth2   @aaronpk
aaron.pk/oauth2   @aaronpk
aaron.pk/oauth2   @aaronpk
The Spec
                    Read it.

It’s not that bad, I promise.

      aaron.pk/oauth2-10
But which draft? There are 16!!




aaron.pk/oauth2                      @aaronpk
Currently Implemented Drafts
Provider       Draft       Reference

Foursquare     -10         http://aaron.pk/2YS
                           http://code.google.com/apis/accounts/docs/
Google         -10
                           OAuth2.html
Gowalla        -8          http://gowalla.com/api/docs/oauth
                           https://developers.facebook.com/docs/
Facebook       -10 (ish)
                           authentication/oauth2_updates/
Windows Live   -10         http://aaron.pk/2YV

Salesforce     -10         http://aaron.pk/2YW

Github         -07         http://develop.github.com/p/oauth.html

Geoloqi        -10         http://geoloqi.org/API                  @aaronpk
Abstract Protocol Flow




aaron.pk/oauth2             @aaronpk
Definitions




aaron.pk/oauth2   @aaronpk
1. Authorization


aaron.pk/oauth2                @aaronpk
Create a “Log In” link
Link to:

https://geoloqi.com/oauth/authorize?
response_type=code&client_id=YOUR_CLIENT_ID
&redirect_uri=REDIRECT_URI




aaron.pk/oauth2                       @aaronpk
Send the user to the auth page
https://geoloqi.com/oauth/authorize?
response_type=code&client_id=YOUR_CLIENT_ID
&redirect_uri=REDIRECT_URI




aaron.pk/oauth2                         @aaronpk
On success, user is redirected
back to your site with auth code
https://example.com/auth?code=AUTH_CODE_HERE




On error, user is redirected back
to your site with error code
https://example.com/auth?error=access_denied




aaron.pk/oauth2                         @aaronpk
Exchange auth code for an
access token
Your server makes the following request

POST https://api.geoloqi.com/1/oauth/token

Post Body:
grant_type=authorization_code
&code=CODE_FROM_QUERY_STRING
&redirect_uri=REDIRECT_URI
&client_id=YOUR_CLIENT_ID
&client_secret=YOUR_CLIENT_SECRET




aaron.pk/oauth2                           @aaronpk
Exchange auth code for an
access token (response)
Your server gets a response like the following

{
    "access_token":"RsT5OjbzRn430zqMLgV3Ia",
    "expires_in":3600,
    "refresh_token":"e1qoXg7Ik2RRua48lXIV"
}

or if there was an error

{
    "error":"invalid_request"
}

aaron.pk/oauth2                                  @aaronpk
2. Accessing Resources


aaron.pk/oauth2          @aaronpk
Use the access token to
make requests
Now you can make requests using the access token.

GET https://api.geoloqi.com/1/account/profile
Authorization: OAuth RsT5OjbzRn430zqMLgV3Ia



Access token can be in an HTTP header or a query
string parameter

https://api.geoloqi.com/1/account/profile?
oauth_token=RsT5OjbzRn430zqMLgV3Ia



aaron.pk/oauth2                              @aaronpk
Eventually the access token
will expire
When you make a request with an expired token,
you will get this response

{
    "error":"expired_token"
}



Now you need to get a new access token!




aaron.pk/oauth2                             @aaronpk
Get a new access token
using a refresh token
Your server makes the following request

POST https://api.geoloqi.com/1/oauth/token

grant_type=refresh_token
&reresh_token=e1qoXg7Ik2RRua48lXIV
&client_id=YOUR_CLIENT_ID
&client_secret=YOUR_CLIENT_SECRET

Your server gets a similar response as the original call to
oauth/token with new tokens.

{
    "access_token":"RsT5OjbzRn430zqMLgV3Ia",
    "expires_in":3600,
    "refresh_token":"e1qoXg7Ik2RRua48lXIV"
}
aaron.pk/oauth2                                       @aaronpk
OAuth 2 Clients
Client libraries should handle refreshing the token
automatically behind the scenes.




aaron.pk/oauth2                                   @aaronpk
Authorization Methods
¡  Auth Code

¡  Refresh Token

¡  Password


Draft 10 also has

¡  Assertion


Draft 16 also has

¡  Implicit (for browser-based apps)

¡  Extensions (for defining custom grant types)
aaron.pk/oauth2                                    @aaronpk
Password Grant Type
   Suitable for mobile or
   native desktop apps where
   a web browser flow would
   be awkward.


   This breaks the
   fundamental benefit of
   OAuth (not giving your
   password to third parties),
   so should probably be
   limited to your own apps.


aaron.pk/oauth2
Password Grant
Your server makes the following request

POST https://api.geoloqi.com/1/oauth/token

grant_type=password
&username=USERNAME
&password=PASSWORD
&client_id=YOUR_CLIENT_ID
&client_secret=YOUR_CLIENT_SECRET

Your server gets a similar response as the original call to
oauth/token with new tokens.

{
    "access_token":"RsT5OjbzRn430zqMLgV3Ia",
    "expires_in":3600,
    "refresh_token":"e1qoXg7Ik2RRua48lXIV"
}
aaron.pk/oauth2                                       @aaronpk
Implicit Grant (-16)
For clients who can’t store a client secret in a secure
way, typically Javascript-based apps.

No concept of refresh tokens, and auth codes are
not used either.

The redirection back to your app will include an
access token in the URL fragment.

https://example.com/auth#access_token=FJQbwq9




aaron.pk/oauth2                                    @aaronpk
Implementing an OAuth Server
Implementing an OAuth
   Server
   ¡  Find a server library already written

   ¡  Choose a draft to implement
      ¡  Draft 10 – more likely that your users will be familiar with it
      ¡  Latest Draft – if you want to show you’re bleeding edge ;)

   ¡  Read the spec of your chosen draft, in its entirety.
      ¡  These people didn’t write the spec for you to ignore it.
      ¡  Each word is chosen carefully.

   ¡  Ultimately, each implementation is somewhat different, since in
       many cases the spec says SHOULD and leaves the choice up to
       the implementer.
aaron.pk/oauth2                                                             @aaronpk
Limiting Access to Third Parties




aaron.pk/oauth2                       @aaronpk
Proposed New UI for Twitter
by Ben Ward




http://blog.benward.me/post/968515729
OAuth 2 scope
   ¡  Created to limit access to the third party.

   ¡  The scope of the access request expressed as a
       list of space-delimited, case sensitive strings.

   ¡  The value is defined by the authorization server.

   ¡  If the value contains multiple space-delimited
       strings, their order does not matter, and each
       string adds an additional access range to the
       requested scope.



aaron.pk/oauth2                                            @aaronpk
OAuth 2 scope on Facebook
    https://www.facebook.com/dialog/oauth?
    client_id=YOUR_APP_ID&redirect_uri=YOUR_URL
    &scope=email,read_stream




aaron.pk/oauth2                                   @aaronpk
OAuth 2 scope on Github
    https://github.com/login/oauth/authorize?
      client_id=...&scope=user,public_repo




aaron.pk/oauth2                                 @aaronpk
OAuth 2 scope on your service
   ¡  Think about what scopes you might offer

   ¡  Don’t over-complicate it for your users

   ¡  Read vs write is a good start




aaron.pk/oauth2                                  @aaronpk
Join the Mailing List!
¡  https://www.ietf.org/mailman/listinfo/oauth

¡  People talk about OAuth

¡  Keep up to date on changes

¡  People argue about OAuth

¡  It’s fun!




aaron.pk/oauth2                                   @aaronpk
Raging Debates
¡  March and April 2011

¡  Summary Email: http://aaron.pk/2YX




The question:
Require or recommend using
TLS on the auth redirect?

aaron.pk/oauth2                          @aaronpk
Require TLS on auth redirect?
   ¡  When the auth server redirects back to the client with an
       auth code in the query string, an MITM attack is possible
       unless the client’s server is using https

   ¡  Problem: It is not always practical to run your site with https

   ¡  Certificates aren’t the only barrier

   ¡  Loading off-site content (banner ads, site statistics, etc)
       would also have to use https, otherwise the visitor sees
       terrible warning messages

   ¡  https is often slower, since browsers don’t like to cache things

aaron.pk/oauth2                                                          @aaronpk
Require TLS on auth redirect?
   ¡  Many large providers (Google, Facebook) won’t require
       it, because they don’t want to force developers to have
       SSL certificates (would lead to lower adoption)

   ¡  Many enterprise users do want to require it, because they
       are more concerned with security than high adoption of
       their API

   ¡  The question is whether the spec should require it or just
       recommend, if it does, then Google/Facebook/others
       won’t be compliant



aaron.pk/oauth2                                                     @aaronpk
Require TLS on auth redirect?
“This debate is just like talking about highway safety. We
know how to make driving 100% safe. Everyone will drive
tanks at no faster than 10mph, or alternatively, no one will
drive and we’ll all climb on conveyor belts to get anywhere
(each bubble wrapped and put into a medically induced
coma to make sure we don’t move around). But in the real
world, practical considerations trump 100% guarantees.

By just offering services online you put users at some risk. If
you want 100% safe online banking, just don’t offer any.”



Excerpt of an email to the oauth-wg list from Eran Hammer-Lahav: http://aaron.pk/2Ya
draft-ietf-oauth-v2-16




aaron.pk/oauth2           @aaronpk
Moving access into
                     separate specs
                       Bearer tokens vs MAC
                              authentication

aaron.pk/oauth2                         @aaronpk
Draft 10
GET /1/profile HTTP/1.1
Host: api.example.com
Authorization: OAuth vF9dft4qmT


Draft 16
GET /1/profile HTTP/1.1
Host: api.example.com
Authorization: Bearer vF9dft4qmT

or

GET /1/profile HTTP/1.1
Host: api.example.com
Authorization: MAC id="jd93dh9dh39D",
                   nonce="273156:di3hvdf8",
                   bodyhash="k9kbtCIyI3/FEfpS/oIDjk6k=",
                   mac="W7bdMZbv9UWOTadASIQHagZyirA="
http://tools.ietf.org/html/draft-ietf-oauth-v2-10#section-5
http://tools.ietf.org/html/draft-ietf-oauth-v2-bearer-04#section-2
                                                                       @aaronpk
http://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac-00#section-3
Security Recommendations
for Clients Using Bearer Tokens
¡  Safeguard bearer tokens

¡  Validate SSL certificates

¡  Always use https

¡  Don’t store bearer tokens in plaintext cookies

¡  Issue short-lived bearer tokens

¡  Don’t pass bearer tokens in page URLs




aaron.pk/oauth2                                      @aaronpk
http://code.flickr.com/blog/2011/06/21/flickr-now-supports-oauth-1-0a/




              Currently, we only support OAuth 1.0a,
              but we have plans to eventually support
              OAuth 2.0. The decision was based on
              the fact that OAuth 2.0 is still an evolving
              definition that is rapidly changing.
Nothing is perfect.
           Everything changes.
                    Go build stuff.


aaron.pk/oauth2                         @aaronpk
Thanks.
     Aaron Parecki
         @aaronpk
 aaronparecki.com
github.com/aaronpk

More Related Content

What's hot

Implementing OAuth with PHP
Implementing OAuth with PHPImplementing OAuth with PHP
Implementing OAuth with PHPLorna Mitchell
 
An Introduction to OAuth 2
An Introduction to OAuth 2An Introduction to OAuth 2
An Introduction to OAuth 2Aaron Parecki
 
LinkedIn OAuth: Zero To Hero
LinkedIn OAuth: Zero To HeroLinkedIn OAuth: Zero To Hero
LinkedIn OAuth: Zero To HeroTaylor Singletary
 
Security for oauth 2.0 - @topavankumarj
Security for oauth 2.0 - @topavankumarjSecurity for oauth 2.0 - @topavankumarj
Security for oauth 2.0 - @topavankumarjPavan Kumar J
 
OAuth2 - Introduction
OAuth2 - IntroductionOAuth2 - Introduction
OAuth2 - IntroductionKnoldus Inc.
 
An Introduction to OAuth2
An Introduction to OAuth2An Introduction to OAuth2
An Introduction to OAuth2Aaron Parecki
 
Securing RESTful APIs using OAuth 2 and OpenID Connect
Securing RESTful APIs using OAuth 2 and OpenID ConnectSecuring RESTful APIs using OAuth 2 and OpenID Connect
Securing RESTful APIs using OAuth 2 and OpenID ConnectJonathan LeBlanc
 
OAuth - Open API Authentication
OAuth - Open API AuthenticationOAuth - Open API Authentication
OAuth - Open API Authenticationleahculver
 
OAuth Hacks A gentle introduction to OAuth 2 and Apache Oltu
OAuth Hacks A gentle introduction to OAuth 2 and Apache OltuOAuth Hacks A gentle introduction to OAuth 2 and Apache Oltu
OAuth Hacks A gentle introduction to OAuth 2 and Apache OltuAntonio Sanso
 
Oauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 supportOauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 supportGaurav Sharma
 
Stateless Auth using OAuth2 & JWT
Stateless Auth using OAuth2 & JWTStateless Auth using OAuth2 & JWT
Stateless Auth using OAuth2 & JWTGaurav Roy
 
An introduction to OAuth 2
An introduction to OAuth 2An introduction to OAuth 2
An introduction to OAuth 2Sanjoy Kumar Roy
 
Using OAuth with PHP
Using OAuth with PHPUsing OAuth with PHP
Using OAuth with PHPDavid Ingram
 
UC2013 Speed Geeking: Intro to OAuth2
UC2013 Speed Geeking: Intro to OAuth2UC2013 Speed Geeking: Intro to OAuth2
UC2013 Speed Geeking: Intro to OAuth2Aaron Parecki
 

What's hot (20)

Implementing OAuth with PHP
Implementing OAuth with PHPImplementing OAuth with PHP
Implementing OAuth with PHP
 
The State of OAuth2
The State of OAuth2The State of OAuth2
The State of OAuth2
 
An Introduction to OAuth 2
An Introduction to OAuth 2An Introduction to OAuth 2
An Introduction to OAuth 2
 
OAuth 2
OAuth 2OAuth 2
OAuth 2
 
LinkedIn OAuth: Zero To Hero
LinkedIn OAuth: Zero To HeroLinkedIn OAuth: Zero To Hero
LinkedIn OAuth: Zero To Hero
 
Security for oauth 2.0 - @topavankumarj
Security for oauth 2.0 - @topavankumarjSecurity for oauth 2.0 - @topavankumarj
Security for oauth 2.0 - @topavankumarj
 
OAuth2 - Introduction
OAuth2 - IntroductionOAuth2 - Introduction
OAuth2 - Introduction
 
An Introduction to OAuth2
An Introduction to OAuth2An Introduction to OAuth2
An Introduction to OAuth2
 
OAuth 2.0
OAuth 2.0OAuth 2.0
OAuth 2.0
 
Securing RESTful APIs using OAuth 2 and OpenID Connect
Securing RESTful APIs using OAuth 2 and OpenID ConnectSecuring RESTful APIs using OAuth 2 and OpenID Connect
Securing RESTful APIs using OAuth 2 and OpenID Connect
 
OAuth - Open API Authentication
OAuth - Open API AuthenticationOAuth - Open API Authentication
OAuth - Open API Authentication
 
OAuth Hacks A gentle introduction to OAuth 2 and Apache Oltu
OAuth Hacks A gentle introduction to OAuth 2 and Apache OltuOAuth Hacks A gentle introduction to OAuth 2 and Apache Oltu
OAuth Hacks A gentle introduction to OAuth 2 and Apache Oltu
 
Demystifying OAuth 2.0
Demystifying OAuth 2.0Demystifying OAuth 2.0
Demystifying OAuth 2.0
 
Oauth 2.0
Oauth 2.0Oauth 2.0
Oauth 2.0
 
Oauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 supportOauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 support
 
Stateless Auth using OAuth2 & JWT
Stateless Auth using OAuth2 & JWTStateless Auth using OAuth2 & JWT
Stateless Auth using OAuth2 & JWT
 
An introduction to OAuth 2
An introduction to OAuth 2An introduction to OAuth 2
An introduction to OAuth 2
 
Using OAuth with PHP
Using OAuth with PHPUsing OAuth with PHP
Using OAuth with PHP
 
UC2013 Speed Geeking: Intro to OAuth2
UC2013 Speed Geeking: Intro to OAuth2UC2013 Speed Geeking: Intro to OAuth2
UC2013 Speed Geeking: Intro to OAuth2
 
OAuth2 + API Security
OAuth2 + API SecurityOAuth2 + API Security
OAuth2 + API Security
 

Similar to The Current State of OAuth 2

INTERFACE by apidays - The State of OAuth by Aaron Parecki,
INTERFACE by apidays - The State of OAuth by Aaron Parecki,INTERFACE by apidays - The State of OAuth by Aaron Parecki,
INTERFACE by apidays - The State of OAuth by Aaron Parecki,apidays
 
Introduction to OAuth
Introduction to OAuthIntroduction to OAuth
Introduction to OAuthPaul Osman
 
UserCentric Identity based Service Invocation
UserCentric Identity based Service InvocationUserCentric Identity based Service Invocation
UserCentric Identity based Service Invocationguestd5dde6
 
OAuth - Don’t Throw the Baby Out with the Bathwater
OAuth - Don’t Throw the Baby Out with the Bathwater OAuth - Don’t Throw the Baby Out with the Bathwater
OAuth - Don’t Throw the Baby Out with the Bathwater Apigee | Google Cloud
 
アプリ開発で知っておきたい認証技術 - OAuth 1.0 + OAuth 2.0 + OpenID Connect -
アプリ開発で知っておきたい認証技術 - OAuth 1.0 + OAuth 2.0 + OpenID Connect -アプリ開発で知っておきたい認証技術 - OAuth 1.0 + OAuth 2.0 + OpenID Connect -
アプリ開発で知っておきたい認証技術 - OAuth 1.0 + OAuth 2.0 + OpenID Connect -Naoki Nagazumi
 
iMasters Intercon 2016 - Identity within Microservices
iMasters Intercon 2016 - Identity within MicroservicesiMasters Intercon 2016 - Identity within Microservices
iMasters Intercon 2016 - Identity within MicroservicesErick Belluci Tedeschi
 
InterCon 2016 - Segurança de identidade digital levando em consideração uma a...
InterCon 2016 - Segurança de identidade digital levando em consideração uma a...InterCon 2016 - Segurança de identidade digital levando em consideração uma a...
InterCon 2016 - Segurança de identidade digital levando em consideração uma a...iMasters
 
Api security with OAuth
Api security with OAuthApi security with OAuth
Api security with OAuththariyarox
 
Securing your apps with OAuth2 and OpenID Connect - Roland Guijt - Codemotion...
Securing your apps with OAuth2 and OpenID Connect - Roland Guijt - Codemotion...Securing your apps with OAuth2 and OpenID Connect - Roland Guijt - Codemotion...
Securing your apps with OAuth2 and OpenID Connect - Roland Guijt - Codemotion...Codemotion
 
OAuth 2.0 and Library
OAuth 2.0 and LibraryOAuth 2.0 and Library
OAuth 2.0 and LibraryKenji Otsuka
 
REST API Security: OAuth 2.0, JWTs, and More!
REST API Security: OAuth 2.0, JWTs, and More!REST API Security: OAuth 2.0, JWTs, and More!
REST API Security: OAuth 2.0, JWTs, and More!Stormpath
 
How OAuth and portable data can revolutionize your web app - Chris Messina
How OAuth and portable data can revolutionize your web app - Chris MessinaHow OAuth and portable data can revolutionize your web app - Chris Messina
How OAuth and portable data can revolutionize your web app - Chris MessinaCarsonified Team
 
OAuth and OEmbed
OAuth and OEmbedOAuth and OEmbed
OAuth and OEmbedleahculver
 
Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013
Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013
Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013Aaron Parecki
 
Securing APIs
Securing APIsSecuring APIs
Securing APIsWSO2
 
AllTheTalks.Online 2020: "Basics of OAuth 2.0 and OpenID Connect"
AllTheTalks.Online 2020: "Basics of OAuth 2.0 and OpenID Connect"AllTheTalks.Online 2020: "Basics of OAuth 2.0 and OpenID Connect"
AllTheTalks.Online 2020: "Basics of OAuth 2.0 and OpenID Connect"Andreas Falk
 
ORCID OAuth Dance with google playground
ORCID OAuth Dance with google playgroundORCID OAuth Dance with google playground
ORCID OAuth Dance with google playgroundORCID, Inc
 

Similar to The Current State of OAuth 2 (20)

INTERFACE by apidays - The State of OAuth by Aaron Parecki,
INTERFACE by apidays - The State of OAuth by Aaron Parecki,INTERFACE by apidays - The State of OAuth by Aaron Parecki,
INTERFACE by apidays - The State of OAuth by Aaron Parecki,
 
Introduction to OAuth
Introduction to OAuthIntroduction to OAuth
Introduction to OAuth
 
UserCentric Identity based Service Invocation
UserCentric Identity based Service InvocationUserCentric Identity based Service Invocation
UserCentric Identity based Service Invocation
 
OAuth - Don’t Throw the Baby Out with the Bathwater
OAuth - Don’t Throw the Baby Out with the Bathwater OAuth - Don’t Throw the Baby Out with the Bathwater
OAuth - Don’t Throw the Baby Out with the Bathwater
 
アプリ開発で知っておきたい認証技術 - OAuth 1.0 + OAuth 2.0 + OpenID Connect -
アプリ開発で知っておきたい認証技術 - OAuth 1.0 + OAuth 2.0 + OpenID Connect -アプリ開発で知っておきたい認証技術 - OAuth 1.0 + OAuth 2.0 + OpenID Connect -
アプリ開発で知っておきたい認証技術 - OAuth 1.0 + OAuth 2.0 + OpenID Connect -
 
iMasters Intercon 2016 - Identity within Microservices
iMasters Intercon 2016 - Identity within MicroservicesiMasters Intercon 2016 - Identity within Microservices
iMasters Intercon 2016 - Identity within Microservices
 
InterCon 2016 - Segurança de identidade digital levando em consideração uma a...
InterCon 2016 - Segurança de identidade digital levando em consideração uma a...InterCon 2016 - Segurança de identidade digital levando em consideração uma a...
InterCon 2016 - Segurança de identidade digital levando em consideração uma a...
 
Demystifying REST
Demystifying RESTDemystifying REST
Demystifying REST
 
Api security with OAuth
Api security with OAuthApi security with OAuth
Api security with OAuth
 
Securing your apps with OAuth2 and OpenID Connect - Roland Guijt - Codemotion...
Securing your apps with OAuth2 and OpenID Connect - Roland Guijt - Codemotion...Securing your apps with OAuth2 and OpenID Connect - Roland Guijt - Codemotion...
Securing your apps with OAuth2 and OpenID Connect - Roland Guijt - Codemotion...
 
OAuth 2.0 and Library
OAuth 2.0 and LibraryOAuth 2.0 and Library
OAuth 2.0 and Library
 
Some OAuth love
Some OAuth loveSome OAuth love
Some OAuth love
 
REST API Security: OAuth 2.0, JWTs, and More!
REST API Security: OAuth 2.0, JWTs, and More!REST API Security: OAuth 2.0, JWTs, and More!
REST API Security: OAuth 2.0, JWTs, and More!
 
OAuth FTW
OAuth FTWOAuth FTW
OAuth FTW
 
How OAuth and portable data can revolutionize your web app - Chris Messina
How OAuth and portable data can revolutionize your web app - Chris MessinaHow OAuth and portable data can revolutionize your web app - Chris Messina
How OAuth and portable data can revolutionize your web app - Chris Messina
 
OAuth and OEmbed
OAuth and OEmbedOAuth and OEmbed
OAuth and OEmbed
 
Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013
Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013
Using ArcGIS with OAuth 2.0 - Esri DevSummit Dubai 2013
 
Securing APIs
Securing APIsSecuring APIs
Securing APIs
 
AllTheTalks.Online 2020: "Basics of OAuth 2.0 and OpenID Connect"
AllTheTalks.Online 2020: "Basics of OAuth 2.0 and OpenID Connect"AllTheTalks.Online 2020: "Basics of OAuth 2.0 and OpenID Connect"
AllTheTalks.Online 2020: "Basics of OAuth 2.0 and OpenID Connect"
 
ORCID OAuth Dance with google playground
ORCID OAuth Dance with google playgroundORCID OAuth Dance with google playground
ORCID OAuth Dance with google playground
 

More from Aaron Parecki

Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013
Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013
Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013Aaron Parecki
 
Building Web Apps with the Esri-Leaflet Plugin - Dubai DevSummit 2013
Building Web Apps with the Esri-Leaflet Plugin - Dubai DevSummit 2013Building Web Apps with the Esri-Leaflet Plugin - Dubai DevSummit 2013
Building Web Apps with the Esri-Leaflet Plugin - Dubai DevSummit 2013Aaron Parecki
 
Rule Your Geometry with the Terraformer Toolkit
Rule Your Geometry with the Terraformer ToolkitRule Your Geometry with the Terraformer Toolkit
Rule Your Geometry with the Terraformer ToolkitAaron Parecki
 
Intro to the ArcGIS Geotrigger Service
Intro to the ArcGIS Geotrigger ServiceIntro to the ArcGIS Geotrigger Service
Intro to the ArcGIS Geotrigger ServiceAaron Parecki
 
Low Friction Personal Data Collection - Quantified Self Global Conference 2013
Low Friction Personal Data Collection - Quantified Self Global Conference 2013Low Friction Personal Data Collection - Quantified Self Global Conference 2013
Low Friction Personal Data Collection - Quantified Self Global Conference 2013Aaron Parecki
 
Low Friction Personal Data Collection - QS Portland
Low Friction Personal Data Collection - QS PortlandLow Friction Personal Data Collection - QS Portland
Low Friction Personal Data Collection - QS PortlandAaron Parecki
 
Done Reports - Open Source Bridge
Done Reports - Open Source BridgeDone Reports - Open Source Bridge
Done Reports - Open Source BridgeAaron Parecki
 
Esri DevSummit 2013 Speed Geeking: Intro to Esri Geotrigger Service for ArcGIS
Esri DevSummit 2013 Speed Geeking: Intro to Esri Geotrigger Service for ArcGISEsri DevSummit 2013 Speed Geeking: Intro to Esri Geotrigger Service for ArcGIS
Esri DevSummit 2013 Speed Geeking: Intro to Esri Geotrigger Service for ArcGISAaron Parecki
 
Low Friction Personal Data Collection - Open Source Bridge
Low Friction Personal Data Collection - Open Source BridgeLow Friction Personal Data Collection - Open Source Bridge
Low Friction Personal Data Collection - Open Source BridgeAaron Parecki
 
Low Friction Personal Data Collection - CyborgCamp 2012
Low Friction Personal Data Collection - CyborgCamp 2012Low Friction Personal Data Collection - CyborgCamp 2012
Low Friction Personal Data Collection - CyborgCamp 2012Aaron Parecki
 
Personal Data Collection Breakout Session Notes
Personal Data Collection Breakout Session NotesPersonal Data Collection Breakout Session Notes
Personal Data Collection Breakout Session NotesAaron Parecki
 
Home Automation with SMS and GPS
Home Automation with SMS and GPSHome Automation with SMS and GPS
Home Automation with SMS and GPSAaron Parecki
 
Ambient Discovery - Augmented Reality Event 2011
Ambient Discovery - Augmented Reality Event 2011Ambient Discovery - Augmented Reality Event 2011
Ambient Discovery - Augmented Reality Event 2011Aaron Parecki
 
Geolocation in Web and Native Mobile Apps
Geolocation in Web and Native Mobile AppsGeolocation in Web and Native Mobile Apps
Geolocation in Web and Native Mobile AppsAaron Parecki
 
Ambient Location Apps and Geoloqi
Ambient Location Apps and GeoloqiAmbient Location Apps and Geoloqi
Ambient Location Apps and GeoloqiAaron Parecki
 
Geoloqi iPhone App Tour
Geoloqi iPhone App TourGeoloqi iPhone App Tour
Geoloqi iPhone App TourAaron Parecki
 
The Vowel R - Ignite Portland 9
The Vowel R - Ignite Portland 9The Vowel R - Ignite Portland 9
The Vowel R - Ignite Portland 9Aaron Parecki
 
Geoloqi: Non-visual augmented reality Open Source Bridge
Geoloqi: Non-visual augmented reality Open Source BridgeGeoloqi: Non-visual augmented reality Open Source Bridge
Geoloqi: Non-visual augmented reality Open Source BridgeAaron Parecki
 

More from Aaron Parecki (18)

Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013
Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013
Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013
 
Building Web Apps with the Esri-Leaflet Plugin - Dubai DevSummit 2013
Building Web Apps with the Esri-Leaflet Plugin - Dubai DevSummit 2013Building Web Apps with the Esri-Leaflet Plugin - Dubai DevSummit 2013
Building Web Apps with the Esri-Leaflet Plugin - Dubai DevSummit 2013
 
Rule Your Geometry with the Terraformer Toolkit
Rule Your Geometry with the Terraformer ToolkitRule Your Geometry with the Terraformer Toolkit
Rule Your Geometry with the Terraformer Toolkit
 
Intro to the ArcGIS Geotrigger Service
Intro to the ArcGIS Geotrigger ServiceIntro to the ArcGIS Geotrigger Service
Intro to the ArcGIS Geotrigger Service
 
Low Friction Personal Data Collection - Quantified Self Global Conference 2013
Low Friction Personal Data Collection - Quantified Self Global Conference 2013Low Friction Personal Data Collection - Quantified Self Global Conference 2013
Low Friction Personal Data Collection - Quantified Self Global Conference 2013
 
Low Friction Personal Data Collection - QS Portland
Low Friction Personal Data Collection - QS PortlandLow Friction Personal Data Collection - QS Portland
Low Friction Personal Data Collection - QS Portland
 
Done Reports - Open Source Bridge
Done Reports - Open Source BridgeDone Reports - Open Source Bridge
Done Reports - Open Source Bridge
 
Esri DevSummit 2013 Speed Geeking: Intro to Esri Geotrigger Service for ArcGIS
Esri DevSummit 2013 Speed Geeking: Intro to Esri Geotrigger Service for ArcGISEsri DevSummit 2013 Speed Geeking: Intro to Esri Geotrigger Service for ArcGIS
Esri DevSummit 2013 Speed Geeking: Intro to Esri Geotrigger Service for ArcGIS
 
Low Friction Personal Data Collection - Open Source Bridge
Low Friction Personal Data Collection - Open Source BridgeLow Friction Personal Data Collection - Open Source Bridge
Low Friction Personal Data Collection - Open Source Bridge
 
Low Friction Personal Data Collection - CyborgCamp 2012
Low Friction Personal Data Collection - CyborgCamp 2012Low Friction Personal Data Collection - CyborgCamp 2012
Low Friction Personal Data Collection - CyborgCamp 2012
 
Personal Data Collection Breakout Session Notes
Personal Data Collection Breakout Session NotesPersonal Data Collection Breakout Session Notes
Personal Data Collection Breakout Session Notes
 
Home Automation with SMS and GPS
Home Automation with SMS and GPSHome Automation with SMS and GPS
Home Automation with SMS and GPS
 
Ambient Discovery - Augmented Reality Event 2011
Ambient Discovery - Augmented Reality Event 2011Ambient Discovery - Augmented Reality Event 2011
Ambient Discovery - Augmented Reality Event 2011
 
Geolocation in Web and Native Mobile Apps
Geolocation in Web and Native Mobile AppsGeolocation in Web and Native Mobile Apps
Geolocation in Web and Native Mobile Apps
 
Ambient Location Apps and Geoloqi
Ambient Location Apps and GeoloqiAmbient Location Apps and Geoloqi
Ambient Location Apps and Geoloqi
 
Geoloqi iPhone App Tour
Geoloqi iPhone App TourGeoloqi iPhone App Tour
Geoloqi iPhone App Tour
 
The Vowel R - Ignite Portland 9
The Vowel R - Ignite Portland 9The Vowel R - Ignite Portland 9
The Vowel R - Ignite Portland 9
 
Geoloqi: Non-visual augmented reality Open Source Bridge
Geoloqi: Non-visual augmented reality Open Source BridgeGeoloqi: Non-visual augmented reality Open Source Bridge
Geoloqi: Non-visual augmented reality Open Source Bridge
 

Recently uploaded

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 

Recently uploaded (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 

The Current State of OAuth 2

  • 1. The Current State of OAuth 2 Aaron Parecki • @aaronpk Open Source Bridge • Portland, June 2011
  • 3. Before OAuth aka the Dark Ages If a third party wanted access to an account, you’d give them your password. aaron.pk/oauth2 @aaronpk
  • 4. Before OAuth 1.0 Many sites implemented things similar to OAuth 1.0, with slight differences between them. ¡  Flickr: “FlickrAuth” frobs and tokens ¡  Google: “AuthSub” ¡  Facebook: requests signed with MD5 hashes aaron.pk/oauth2 @aaronpk
  • 6. OAuth 1.0 Signatures The signature base string is often the most difficult part of OAuth for newcomers to construct. The signature base string is composed of the HTTP method being used, followed by an ampersand ("&") and then the URL-encoded base URL being accessed, complete with path (but not query parameters), followed by an ampersand ("&"). Then, you take all query parameters and POST body parameters (when the POST body is of the URL-encoded type, otherwise the POST body is ignored), including the OAuth parameters necessary for negotiation with the request at hand, and sort them in lexicographical order by first parameter name and oauth_nonce="QP70eNmVz8jvdPevU3oJD2AfF7R7o then parameter value (for duplicate parameters), all the while ensuring that both the key and the value for oauth_callback="http%3A%2F dC2XJcn4XlZJqk", each %2Flocalhost%3A3005%2Fthe_dance parameter are URL encoded in isolation. Instead of using the %2Fprocess_callback%3Fservice_provider_id equals ("=") sign to mark the key/value relationship, you use the URL-encoded form of "%3D". Each parameter is then %3D11", oauth_signature_method="HMAC-SHA1", joined by the URL-escaped ampersand sign, "%26". oauth_timestamp="1272323042", oauth_consumer_key="GDdmIQH6jhtmLUypg82g", oauth_signature="8wUi7m5HFQy76nowoCThusfgB %2BQ%3D", oauth_version="1.0" aaron.pk/oauth2 @aaronpk
  • 7. OAuth 2: signatures replaced by https HMAC aaron.pk/oauth2 @aaronpk
  • 9. Facebook’s OAuth Flow Source: https://developers.facebook.com/docs/authentication/ @aaronpk
  • 10. aaron.pk/oauth2 @aaronpk
  • 11. aaron.pk/oauth2 @aaronpk
  • 12. aaron.pk/oauth2 @aaronpk
  • 13. The Spec Read it. It’s not that bad, I promise. aaron.pk/oauth2-10
  • 14. But which draft? There are 16!! aaron.pk/oauth2 @aaronpk
  • 15. Currently Implemented Drafts Provider Draft Reference Foursquare -10 http://aaron.pk/2YS http://code.google.com/apis/accounts/docs/ Google -10 OAuth2.html Gowalla -8 http://gowalla.com/api/docs/oauth https://developers.facebook.com/docs/ Facebook -10 (ish) authentication/oauth2_updates/ Windows Live -10 http://aaron.pk/2YV Salesforce -10 http://aaron.pk/2YW Github -07 http://develop.github.com/p/oauth.html Geoloqi -10 http://geoloqi.org/API @aaronpk
  • 19. Create a “Log In” link Link to: https://geoloqi.com/oauth/authorize? response_type=code&client_id=YOUR_CLIENT_ID &redirect_uri=REDIRECT_URI aaron.pk/oauth2 @aaronpk
  • 20. Send the user to the auth page https://geoloqi.com/oauth/authorize? response_type=code&client_id=YOUR_CLIENT_ID &redirect_uri=REDIRECT_URI aaron.pk/oauth2 @aaronpk
  • 21. On success, user is redirected back to your site with auth code https://example.com/auth?code=AUTH_CODE_HERE On error, user is redirected back to your site with error code https://example.com/auth?error=access_denied aaron.pk/oauth2 @aaronpk
  • 22. Exchange auth code for an access token Your server makes the following request POST https://api.geoloqi.com/1/oauth/token Post Body: grant_type=authorization_code &code=CODE_FROM_QUERY_STRING &redirect_uri=REDIRECT_URI &client_id=YOUR_CLIENT_ID &client_secret=YOUR_CLIENT_SECRET aaron.pk/oauth2 @aaronpk
  • 23. Exchange auth code for an access token (response) Your server gets a response like the following { "access_token":"RsT5OjbzRn430zqMLgV3Ia", "expires_in":3600, "refresh_token":"e1qoXg7Ik2RRua48lXIV" } or if there was an error { "error":"invalid_request" } aaron.pk/oauth2 @aaronpk
  • 25. Use the access token to make requests Now you can make requests using the access token. GET https://api.geoloqi.com/1/account/profile Authorization: OAuth RsT5OjbzRn430zqMLgV3Ia Access token can be in an HTTP header or a query string parameter https://api.geoloqi.com/1/account/profile? oauth_token=RsT5OjbzRn430zqMLgV3Ia aaron.pk/oauth2 @aaronpk
  • 26. Eventually the access token will expire When you make a request with an expired token, you will get this response { "error":"expired_token" } Now you need to get a new access token! aaron.pk/oauth2 @aaronpk
  • 27. Get a new access token using a refresh token Your server makes the following request POST https://api.geoloqi.com/1/oauth/token grant_type=refresh_token &reresh_token=e1qoXg7Ik2RRua48lXIV &client_id=YOUR_CLIENT_ID &client_secret=YOUR_CLIENT_SECRET Your server gets a similar response as the original call to oauth/token with new tokens. { "access_token":"RsT5OjbzRn430zqMLgV3Ia", "expires_in":3600, "refresh_token":"e1qoXg7Ik2RRua48lXIV" } aaron.pk/oauth2 @aaronpk
  • 28. OAuth 2 Clients Client libraries should handle refreshing the token automatically behind the scenes. aaron.pk/oauth2 @aaronpk
  • 29. Authorization Methods ¡  Auth Code ¡  Refresh Token ¡  Password Draft 10 also has ¡  Assertion Draft 16 also has ¡  Implicit (for browser-based apps) ¡  Extensions (for defining custom grant types) aaron.pk/oauth2 @aaronpk
  • 30. Password Grant Type Suitable for mobile or native desktop apps where a web browser flow would be awkward. This breaks the fundamental benefit of OAuth (not giving your password to third parties), so should probably be limited to your own apps. aaron.pk/oauth2
  • 31. Password Grant Your server makes the following request POST https://api.geoloqi.com/1/oauth/token grant_type=password &username=USERNAME &password=PASSWORD &client_id=YOUR_CLIENT_ID &client_secret=YOUR_CLIENT_SECRET Your server gets a similar response as the original call to oauth/token with new tokens. { "access_token":"RsT5OjbzRn430zqMLgV3Ia", "expires_in":3600, "refresh_token":"e1qoXg7Ik2RRua48lXIV" } aaron.pk/oauth2 @aaronpk
  • 32. Implicit Grant (-16) For clients who can’t store a client secret in a secure way, typically Javascript-based apps. No concept of refresh tokens, and auth codes are not used either. The redirection back to your app will include an access token in the URL fragment. https://example.com/auth#access_token=FJQbwq9 aaron.pk/oauth2 @aaronpk
  • 34. Implementing an OAuth Server ¡  Find a server library already written ¡  Choose a draft to implement ¡  Draft 10 – more likely that your users will be familiar with it ¡  Latest Draft – if you want to show you’re bleeding edge ;) ¡  Read the spec of your chosen draft, in its entirety. ¡  These people didn’t write the spec for you to ignore it. ¡  Each word is chosen carefully. ¡  Ultimately, each implementation is somewhat different, since in many cases the spec says SHOULD and leaves the choice up to the implementer. aaron.pk/oauth2 @aaronpk
  • 35. Limiting Access to Third Parties aaron.pk/oauth2 @aaronpk
  • 36. Proposed New UI for Twitter by Ben Ward http://blog.benward.me/post/968515729
  • 37. OAuth 2 scope ¡  Created to limit access to the third party. ¡  The scope of the access request expressed as a list of space-delimited, case sensitive strings. ¡  The value is defined by the authorization server. ¡  If the value contains multiple space-delimited strings, their order does not matter, and each string adds an additional access range to the requested scope. aaron.pk/oauth2 @aaronpk
  • 38. OAuth 2 scope on Facebook https://www.facebook.com/dialog/oauth? client_id=YOUR_APP_ID&redirect_uri=YOUR_URL &scope=email,read_stream aaron.pk/oauth2 @aaronpk
  • 39. OAuth 2 scope on Github https://github.com/login/oauth/authorize? client_id=...&scope=user,public_repo aaron.pk/oauth2 @aaronpk
  • 40. OAuth 2 scope on your service ¡  Think about what scopes you might offer ¡  Don’t over-complicate it for your users ¡  Read vs write is a good start aaron.pk/oauth2 @aaronpk
  • 41. Join the Mailing List! ¡  https://www.ietf.org/mailman/listinfo/oauth ¡  People talk about OAuth ¡  Keep up to date on changes ¡  People argue about OAuth ¡  It’s fun! aaron.pk/oauth2 @aaronpk
  • 42. Raging Debates ¡  March and April 2011 ¡  Summary Email: http://aaron.pk/2YX The question: Require or recommend using TLS on the auth redirect? aaron.pk/oauth2 @aaronpk
  • 43. Require TLS on auth redirect? ¡  When the auth server redirects back to the client with an auth code in the query string, an MITM attack is possible unless the client’s server is using https ¡  Problem: It is not always practical to run your site with https ¡  Certificates aren’t the only barrier ¡  Loading off-site content (banner ads, site statistics, etc) would also have to use https, otherwise the visitor sees terrible warning messages ¡  https is often slower, since browsers don’t like to cache things aaron.pk/oauth2 @aaronpk
  • 44. Require TLS on auth redirect? ¡  Many large providers (Google, Facebook) won’t require it, because they don’t want to force developers to have SSL certificates (would lead to lower adoption) ¡  Many enterprise users do want to require it, because they are more concerned with security than high adoption of their API ¡  The question is whether the spec should require it or just recommend, if it does, then Google/Facebook/others won’t be compliant aaron.pk/oauth2 @aaronpk
  • 45. Require TLS on auth redirect? “This debate is just like talking about highway safety. We know how to make driving 100% safe. Everyone will drive tanks at no faster than 10mph, or alternatively, no one will drive and we’ll all climb on conveyor belts to get anywhere (each bubble wrapped and put into a medically induced coma to make sure we don’t move around). But in the real world, practical considerations trump 100% guarantees. By just offering services online you put users at some risk. If you want 100% safe online banking, just don’t offer any.” Excerpt of an email to the oauth-wg list from Eran Hammer-Lahav: http://aaron.pk/2Ya
  • 46.
  • 48. Moving access into separate specs Bearer tokens vs MAC authentication aaron.pk/oauth2 @aaronpk
  • 49. Draft 10 GET /1/profile HTTP/1.1 Host: api.example.com Authorization: OAuth vF9dft4qmT Draft 16 GET /1/profile HTTP/1.1 Host: api.example.com Authorization: Bearer vF9dft4qmT or GET /1/profile HTTP/1.1 Host: api.example.com Authorization: MAC id="jd93dh9dh39D", nonce="273156:di3hvdf8", bodyhash="k9kbtCIyI3/FEfpS/oIDjk6k=", mac="W7bdMZbv9UWOTadASIQHagZyirA=" http://tools.ietf.org/html/draft-ietf-oauth-v2-10#section-5 http://tools.ietf.org/html/draft-ietf-oauth-v2-bearer-04#section-2 @aaronpk http://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac-00#section-3
  • 50. Security Recommendations for Clients Using Bearer Tokens ¡  Safeguard bearer tokens ¡  Validate SSL certificates ¡  Always use https ¡  Don’t store bearer tokens in plaintext cookies ¡  Issue short-lived bearer tokens ¡  Don’t pass bearer tokens in page URLs aaron.pk/oauth2 @aaronpk
  • 51.
  • 52. http://code.flickr.com/blog/2011/06/21/flickr-now-supports-oauth-1-0a/ Currently, we only support OAuth 1.0a, but we have plans to eventually support OAuth 2.0. The decision was based on the fact that OAuth 2.0 is still an evolving definition that is rapidly changing.
  • 53. Nothing is perfect. Everything changes. Go build stuff. aaron.pk/oauth2 @aaronpk
  • 54. Thanks. Aaron Parecki @aaronpk aaronparecki.com github.com/aaronpk