SlideShare a Scribd company logo
1 of 22
1
SecuringAPIsusingOAuth
Adam Lewis – Motorola Solutions – Chief Technology Office
Securing APIs using OAuth 2.0
SecuringAPIsusingOAuth2.0
Source: ProgrammableWeb.com
http://www.programmableweb.com/news/which-apis-are-handling-billions-requests-day/2012/05/23
3
SecuringAPIsusingOAuth
Source: ProgrammableWeb.com
Growth of APIs
4
SecuringAPIsusingOAuth
Most of these APIs will need to know some very
fundamental things: who is the user of the API, and what
are they authorized to do?
5
SecuringAPIsusingOAuth
In the Beginning …
I have an APII would like to use your API to get access
to my user’s protected resources
I cannot just give you that information.
To prove that user really wants to you
To access their information, I need their
username & password
Please give me your username & password
so that I can access your resources on your behalf
Here is my username & password
(Please be good with it)
webapp
6
SecuringAPIsusingOAuth
And that was bad. Bad. BAD.
(very bad!)
7
SecuringAPIsusingOAuth
The Password “anti-pattern”
Users became promiscuous
with their passwords, handing
them over directly to any API
client that asked for them
Client might not be trustworthy
Even if the client is trustworthy, it might not be
secure and might inadvertently leak the user’s
password or be otherwise prone to attack
If a password is
compromised, or if the client
was rogue to begin with, then
the only way to revoke that
client’s ability to access the
user’s resources would be for
the user to change their
password
And because many other clients
have also stored the user’s password
to access other resource on behalf of
the user, those clients also lose their
ability to access resources.
Finally, giving a third party client access to primary credentials enables the
client to access ALL of user’s information, rather than just a scope of it. For
example, a user might wish to allow a third-party client to access their
Facebook photos, but not to access their Facebook posts. Or they might allow
the client to read their posts, but not make posts on their behalf.
8
SecuringAPIsusingOAuth
9
SecuringAPIsusingOAuth
Defined by the IETF
There was a version 1.0 before it
– But it required client-side crypto,
developers didn’t like it
– 2.0 takes community feedback into account
(more on that later)
10
SecuringAPIsusingOAuth
OAuth gives the user the ability to delegate an authorization
decision to an API client to access their protected resources
without divulging their credentials to that API client
Upon granting the API client authorization, the API client is
issued an access token, representing scope of that
authorization
Both API clients and API servers are abstracted from
requiring a password (really BIG deal!)
11
SecuringAPIsusingOAuth
Client
Resource Server
Authorization
Endpoint
Token
Endpoint
UA
Authorization Server
End User
(possibly RO)
12
SecuringAPIsusingOAuth
User logs into web page
Redirect user’s browser to authorization endpoint
OAuth Authorization Request (requested scope of authorization)
User Authentication Happens Here
Redirect user’s browser back to web app (API client) with authorization code
code
Token Request (authorization_code)
Token Response (access_token)
https://server.com?photos (access token)
“webapp” is requesting
access to the following
resources within your
account: do you whish
to grant this access?
Yes!
webapp
13
SecuringAPIsusingOAuth
User logs into web page
Redirect user’s browser to authorization endpoint
OAuth Authorization Request (response_type=code)
User Authentication Happens Here
Redirect user’s browser back to web app (API client) with authorization code
code
Token Request (authorization_code)
Token Response (access_token)
https://server.com?photos (access token)
GET https://server.example.com/authorize?response_type=code&
client_id=s6BhdRkqt3&redirect_uri=https://client.example.com/cb
&scope=calendar.read_only
HTTP/1.1 302 Found
Location: https://client.example.com/cb?code=SplxlOBeZQQYbYS6WxSbIA
&state=xyz
POST /token HTTP/1.1
Host: server.example.com
Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW
Content-Type: application/x-www-form-urlencoded
grant_type=authorization_code&code=SplxlOBeZQQYbYS6WxSbIA
&redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache
{
"access_token":"2YotnFZFEjr1zCsicMWpAA",
"token_type":"example",
"expires_in":3600,
"refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA",
"example_parameter":"example_value"
}
“webapp” is requesting
access to the following
resources within your
account: do you whish
to grant this access?
Yes!
webapp
14
SecuringAPIsusingOAuth
DEMO
15
SecuringAPIsusingOAuth
About that Token
• Bearer – whoever holds it may use it
– Original OAuth utilized client-side crypto, but developers didn’t
exactly flock to it
– Bearer tokens were a compromise: better than giving passwords to
API clients, less secure than client-side signing
• Structure undefined, but in practice:
– Opaque (requires introspection)
– JWT
• kid, x5t
• Can be embedded in other protocols besides HTTP (SIP, RTSP, etc.)
16
SecuringAPIsusingOAuth
JSON Web Tokens
{
"alg": "RS256",
"x5t": "eZsobkgyfNGOyVpjEHgS2i8QhKQ"
}.
{
"Username": “alice@domain.com",
"exp": 1432744471,
"scope": [
“calendar_api.read_only“,
“contacts.read_only”,
“email.all”
],
"client_id": "s6BhdRkqt3"
}.
U4cL9RFKu_CwdqlpGReAVGA5sxw8d8tLXM4_1Cx7l49KQxeHYkV2ARlv6Qo7sdUSv7k50yhNPR80wFx0WqqtoLY
AKSJ2sXhfqbVTEZrUdDFZUVVYeKOWEyZzZD1w3NCqRm6xhLWmOu05A4gLDUuC7jWagMYquZPywW06SFX
FTa5MN0Nyol3V-QfrFf-XdXTBBUko00ooQf6SsyTcAP08kLuWIl9M2oRLPF_N_f5j1I4oAk5LUMFhdNyGeQ32K-
aU_kLoGxzb20eUlsZVO82zm-94tEdeKZWtp6BtwLICc9wvR1DnMJje7O_dOql1L1DYXNrJ0s7rWRlLwAxthbytww
17
SecuringAPIsusingOAuth
User launches Native App
Redirect user’s browser to authorization endpoint
OAuth Authorization Request (response_type=code)
User Authentication Happens Here
Redirect user’s browser back to web app (API client) with authorization code
code
Token Request (authorization_code)
Token Response (access_token)
https://server.com?photos (access token)
Native
App
18
SecuringAPIsusingOAuth
User launches Native App
Redirect user’s browser to authorization endpoint
OAuth Authorization Request (response_type=code)
User Authentication Happens Here
Redirect user’s browser back to API client with authorization code
code
Token Request (authorization_code)
Token Response (access_token)
https://server.com?photos (access token)
Native
App
SAML request
SAML response
SAML assertion
19
SecuringAPIsusingOAuth
Other WG efforts
• Proof of Possession
• New grant types (SAML, JWT)
• Usage beyond REST
• Building block for OpenID Connect, NAPPS
20
SecuringAPIsusingOAuth
But the grass isn’t all green
• 1.0 was a protocol, 2.0 is a “Framework”
• Flexibility == Complicated
• Interoperability issues
• No standardized access token format
• Not well understood
• It’s NOT for authentication
• Clients often ask for to broad
of a scope
21
SecuringAPIsusingOAuth
But it’s still really good
• Clients never see user credentials
• Resource owners can approve only a limited scope
• Very developer friendly
• Options underway for even higher security
22
SecuringAPIsusingOAuth
And in Closing …
• Questions?
• Comments?
• Scrutiny?
• Thank you! :-)
adam.lewis@motorolasolutions.com

More Related Content

What's hot

API Security & Federation Patterns - Francois Lascelles, Chief Architect, Lay...
API Security & Federation Patterns - Francois Lascelles, Chief Architect, Lay...API Security & Federation Patterns - Francois Lascelles, Chief Architect, Lay...
API Security & Federation Patterns - Francois Lascelles, Chief Architect, Lay...CA API Management
 
Stateless Auth using OAuth2 & JWT
Stateless Auth using OAuth2 & JWTStateless Auth using OAuth2 & JWT
Stateless Auth using OAuth2 & JWTGaurav Roy
 
Making Sense of API Access Control
Making Sense of API Access ControlMaking Sense of API Access Control
Making Sense of API Access ControlCA API Management
 
Token Authentication for Java Applications
Token Authentication for Java ApplicationsToken Authentication for Java Applications
Token Authentication for Java ApplicationsStormpath
 
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
 
An Introduction to OAuth2
An Introduction to OAuth2An Introduction to OAuth2
An Introduction to OAuth2Aaron Parecki
 
Rest API Security
Rest API SecurityRest API Security
Rest API SecurityStormpath
 
An Introduction to OAuth 2
An Introduction to OAuth 2An Introduction to OAuth 2
An Introduction to OAuth 2Aaron Parecki
 
JWT Authentication with AngularJS
JWT Authentication with AngularJSJWT Authentication with AngularJS
JWT Authentication with AngularJSrobertjd
 
ConFoo 2015 - Securing RESTful resources with OAuth2
ConFoo 2015 - Securing RESTful resources with OAuth2ConFoo 2015 - Securing RESTful resources with OAuth2
ConFoo 2015 - Securing RESTful resources with OAuth2Rodrigo Cândido da Silva
 
Stateless authentication for microservices - Greach 2015
Stateless authentication for microservices - Greach 2015Stateless authentication for microservices - Greach 2015
Stateless authentication for microservices - Greach 2015Alvaro Sanchez-Mariscal
 
Spring security oauth2
Spring security oauth2Spring security oauth2
Spring security oauth2axykim00
 
OAuth2 - Introduction
OAuth2 - IntroductionOAuth2 - Introduction
OAuth2 - IntroductionKnoldus Inc.
 
OAuth - Open API Authentication
OAuth - Open API AuthenticationOAuth - Open API Authentication
OAuth - Open API Authenticationleahculver
 
Best Practices in Building an API Security Ecosystem
Best Practices in Building an API Security EcosystemBest Practices in Building an API Security Ecosystem
Best Practices in Building an API Security EcosystemPrabath Siriwardena
 
Stateless authentication for microservices
Stateless authentication for microservicesStateless authentication for microservices
Stateless authentication for microservicesAlvaro Sanchez-Mariscal
 
From 0 to Spring Security 4.0
From 0 to Spring Security 4.0From 0 to Spring Security 4.0
From 0 to Spring Security 4.0robwinch
 
JavaOne 2014 - Securing RESTful Resources with OAuth2
JavaOne 2014 - Securing RESTful Resources with OAuth2JavaOne 2014 - Securing RESTful Resources with OAuth2
JavaOne 2014 - Securing RESTful Resources with OAuth2Rodrigo Cândido da Silva
 

What's hot (20)

API Security & Federation Patterns - Francois Lascelles, Chief Architect, Lay...
API Security & Federation Patterns - Francois Lascelles, Chief Architect, Lay...API Security & Federation Patterns - Francois Lascelles, Chief Architect, Lay...
API Security & Federation Patterns - Francois Lascelles, Chief Architect, Lay...
 
Microservice with OAuth2
Microservice with OAuth2Microservice with OAuth2
Microservice with OAuth2
 
Stateless Auth using OAuth2 & JWT
Stateless Auth using OAuth2 & JWTStateless Auth using OAuth2 & JWT
Stateless Auth using OAuth2 & JWT
 
Making Sense of API Access Control
Making Sense of API Access ControlMaking Sense of API Access Control
Making Sense of API Access Control
 
Token Authentication for Java Applications
Token Authentication for Java ApplicationsToken Authentication for Java Applications
Token Authentication for Java Applications
 
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
 
An Introduction to OAuth2
An Introduction to OAuth2An Introduction to OAuth2
An Introduction to OAuth2
 
Rest API Security
Rest API SecurityRest API Security
Rest API Security
 
An Introduction to OAuth 2
An Introduction to OAuth 2An Introduction to OAuth 2
An Introduction to OAuth 2
 
JWT Authentication with AngularJS
JWT Authentication with AngularJSJWT Authentication with AngularJS
JWT Authentication with AngularJS
 
ConFoo 2015 - Securing RESTful resources with OAuth2
ConFoo 2015 - Securing RESTful resources with OAuth2ConFoo 2015 - Securing RESTful resources with OAuth2
ConFoo 2015 - Securing RESTful resources with OAuth2
 
Stateless authentication for microservices - Greach 2015
Stateless authentication for microservices - Greach 2015Stateless authentication for microservices - Greach 2015
Stateless authentication for microservices - Greach 2015
 
Spring security oauth2
Spring security oauth2Spring security oauth2
Spring security oauth2
 
OAuth2 - Introduction
OAuth2 - IntroductionOAuth2 - Introduction
OAuth2 - Introduction
 
OAuth - Open API Authentication
OAuth - Open API AuthenticationOAuth - Open API Authentication
OAuth - Open API Authentication
 
Best Practices in Building an API Security Ecosystem
Best Practices in Building an API Security EcosystemBest Practices in Building an API Security Ecosystem
Best Practices in Building an API Security Ecosystem
 
Stateless authentication for microservices
Stateless authentication for microservicesStateless authentication for microservices
Stateless authentication for microservices
 
From 0 to Spring Security 4.0
From 0 to Spring Security 4.0From 0 to Spring Security 4.0
From 0 to Spring Security 4.0
 
RESTful Day 5
RESTful Day 5RESTful Day 5
RESTful Day 5
 
JavaOne 2014 - Securing RESTful Resources with OAuth2
JavaOne 2014 - Securing RESTful Resources with OAuth2JavaOne 2014 - Securing RESTful Resources with OAuth2
JavaOne 2014 - Securing RESTful Resources with OAuth2
 

Viewers also liked

Identity as a Matter of Public Safety
Identity as a Matter of Public SafetyIdentity as a Matter of Public Safety
Identity as a Matter of Public SafetyAdam Lewis
 
The Road to Identity 2.0
The Road to Identity 2.0The Road to Identity 2.0
The Road to Identity 2.0Adam Lewis
 
The future of critical voice and data: converged communications platforms
The future of critical voice and data: converged communications platformsThe future of critical voice and data: converged communications platforms
The future of critical voice and data: converged communications platformsJonathan Stubing
 
CIS2016 - MCPTT Connect
CIS2016 - MCPTT ConnectCIS2016 - MCPTT Connect
CIS2016 - MCPTT ConnectAdam Lewis
 
Sintesi automatica di una metrica di similarità tra stringhe tramite tecniche...
Sintesi automatica di una metrica di similarità tra stringhe tramite tecniche...Sintesi automatica di una metrica di similarità tra stringhe tramite tecniche...
Sintesi automatica di una metrica di similarità tra stringhe tramite tecniche...mfurlanetto
 
LTE Architecture and LTE Attach
LTE Architecture and LTE AttachLTE Architecture and LTE Attach
LTE Architecture and LTE Attachaliirfan04
 
LTE ADVANCED PPT
LTE ADVANCED PPTLTE ADVANCED PPT
LTE ADVANCED PPTTrinath
 
Lte security overview
Lte security overviewLte security overview
Lte security overviewaliirfan04
 
Throughput Calculation for LTE TDD and FDD System
Throughput Calculation for  LTE TDD and FDD SystemThroughput Calculation for  LTE TDD and FDD System
Throughput Calculation for LTE TDD and FDD SystemSukhvinder Singh Malik
 
Best practices-lte-call-flow-guide
Best practices-lte-call-flow-guideBest practices-lte-call-flow-guide
Best practices-lte-call-flow-guideMorg
 
Call flow and MS attach in LTE
Call flow and MS attach in LTECall flow and MS attach in LTE
Call flow and MS attach in LTEShashank Asthana
 
How to dimension user traffic in LTE
How to dimension user traffic in LTEHow to dimension user traffic in LTE
How to dimension user traffic in LTEAlthaf Hussain
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheLeslie Samuel
 

Viewers also liked (18)

FirstNet ICAM
FirstNet ICAMFirstNet ICAM
FirstNet ICAM
 
Identity as a Matter of Public Safety
Identity as a Matter of Public SafetyIdentity as a Matter of Public Safety
Identity as a Matter of Public Safety
 
The Road to Identity 2.0
The Road to Identity 2.0The Road to Identity 2.0
The Road to Identity 2.0
 
The future of critical voice and data: converged communications platforms
The future of critical voice and data: converged communications platformsThe future of critical voice and data: converged communications platforms
The future of critical voice and data: converged communications platforms
 
CIS2016 - MCPTT Connect
CIS2016 - MCPTT ConnectCIS2016 - MCPTT Connect
CIS2016 - MCPTT Connect
 
Sintesi automatica di una metrica di similarità tra stringhe tramite tecniche...
Sintesi automatica di una metrica di similarità tra stringhe tramite tecniche...Sintesi automatica di una metrica di similarità tra stringhe tramite tecniche...
Sintesi automatica di una metrica di similarità tra stringhe tramite tecniche...
 
Tdd Versus Fdd
Tdd Versus FddTdd Versus Fdd
Tdd Versus Fdd
 
End-to-End QoS in LTE
End-to-End QoS in LTEEnd-to-End QoS in LTE
End-to-End QoS in LTE
 
LTE Architecture and LTE Attach
LTE Architecture and LTE AttachLTE Architecture and LTE Attach
LTE Architecture and LTE Attach
 
LTE Basics - II
LTE Basics - IILTE Basics - II
LTE Basics - II
 
LTE ADVANCED PPT
LTE ADVANCED PPTLTE ADVANCED PPT
LTE ADVANCED PPT
 
Lte security overview
Lte security overviewLte security overview
Lte security overview
 
CS Services in LTE
CS Services in LTECS Services in LTE
CS Services in LTE
 
Throughput Calculation for LTE TDD and FDD System
Throughput Calculation for  LTE TDD and FDD SystemThroughput Calculation for  LTE TDD and FDD System
Throughput Calculation for LTE TDD and FDD System
 
Best practices-lte-call-flow-guide
Best practices-lte-call-flow-guideBest practices-lte-call-flow-guide
Best practices-lte-call-flow-guide
 
Call flow and MS attach in LTE
Call flow and MS attach in LTECall flow and MS attach in LTE
Call flow and MS attach in LTE
 
How to dimension user traffic in LTE
How to dimension user traffic in LTEHow to dimension user traffic in LTE
How to dimension user traffic in LTE
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
 

Similar to Securing APIs using OAuth 2.0

OAuth In The Real World : 10 actual implementations you can't guess
OAuth In The Real World : 10 actual implementations you can't guessOAuth In The Real World : 10 actual implementations you can't guess
OAuth In The Real World : 10 actual implementations you can't guessMehdi Medjaoui
 
CIS13: Bootcamp: Ping Identity OAuth and OpenID Connect In Action with PingFe...
CIS13: Bootcamp: Ping Identity OAuth and OpenID Connect In Action with PingFe...CIS13: Bootcamp: Ping Identity OAuth and OpenID Connect In Action with PingFe...
CIS13: Bootcamp: Ping Identity OAuth and OpenID Connect In Action with PingFe...CloudIDSummit
 
Devteach 2017 OAuth and Open id connect demystified
Devteach 2017 OAuth and Open id connect demystifiedDevteach 2017 OAuth and Open id connect demystified
Devteach 2017 OAuth and Open id connect demystifiedTaswar Bhatti
 
CIS13: Introduction to OAuth 2.0
CIS13: Introduction to OAuth 2.0CIS13: Introduction to OAuth 2.0
CIS13: Introduction to OAuth 2.0CloudIDSummit
 
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
 
API, Integration, and SOA Convergence
API, Integration, and SOA ConvergenceAPI, Integration, and SOA Convergence
API, Integration, and SOA ConvergenceKasun Indrasiri
 
OAuth with Salesforce - Demystified
OAuth with Salesforce - DemystifiedOAuth with Salesforce - Demystified
OAuth with Salesforce - DemystifiedCalvin Noronha
 
Webapp security (with notes)
Webapp security (with notes)Webapp security (with notes)
Webapp security (with notes)Igor Bossenko
 
Stateless Auth using OAUTH2 & JWT
Stateless Auth using OAUTH2 & JWTStateless Auth using OAUTH2 & JWT
Stateless Auth using OAUTH2 & JWTMobiliya
 
OAuth for QuickBooks Online REST Services
OAuth for QuickBooks Online REST ServicesOAuth for QuickBooks Online REST Services
OAuth for QuickBooks Online REST ServicesIntuit Developer
 
OAuth2 Introduction
OAuth2 IntroductionOAuth2 Introduction
OAuth2 IntroductionArpit Suthar
 
OAuth 2.0 for Web and Native (Mobile) App Developers
OAuth 2.0 for Web and Native (Mobile) App DevelopersOAuth 2.0 for Web and Native (Mobile) App Developers
OAuth 2.0 for Web and Native (Mobile) App DevelopersPrabath Siriwardena
 
O auth2 with angular js
O auth2 with angular jsO auth2 with angular js
O auth2 with angular jsBixlabs
 
CIS13: Identity as a Matter of Public Safety: A Case Study in Secure API Acce...
CIS13: Identity as a Matter of Public Safety: A Case Study in Secure API Acce...CIS13: Identity as a Matter of Public Safety: A Case Study in Secure API Acce...
CIS13: Identity as a Matter of Public Safety: A Case Study in Secure API Acce...CloudIDSummit
 
Stateless authentication for microservices - Spring I/O 2015
Stateless authentication for microservices  - Spring I/O 2015Stateless authentication for microservices  - Spring I/O 2015
Stateless authentication for microservices - Spring I/O 2015Alvaro Sanchez-Mariscal
 
API Management and Mobile App Enablement
API Management and Mobile App EnablementAPI Management and Mobile App Enablement
API Management and Mobile App EnablementCA API Management
 

Similar to Securing APIs using OAuth 2.0 (20)

Oauth2.0
Oauth2.0Oauth2.0
Oauth2.0
 
OAuth In The Real World : 10 actual implementations you can't guess
OAuth In The Real World : 10 actual implementations you can't guessOAuth In The Real World : 10 actual implementations you can't guess
OAuth In The Real World : 10 actual implementations you can't guess
 
CIS13: Bootcamp: Ping Identity OAuth and OpenID Connect In Action with PingFe...
CIS13: Bootcamp: Ping Identity OAuth and OpenID Connect In Action with PingFe...CIS13: Bootcamp: Ping Identity OAuth and OpenID Connect In Action with PingFe...
CIS13: Bootcamp: Ping Identity OAuth and OpenID Connect In Action with PingFe...
 
Devteach 2017 OAuth and Open id connect demystified
Devteach 2017 OAuth and Open id connect demystifiedDevteach 2017 OAuth and Open id connect demystified
Devteach 2017 OAuth and Open id connect demystified
 
Securing RESTful API
Securing RESTful APISecuring RESTful API
Securing RESTful API
 
CIS13: Introduction to OAuth 2.0
CIS13: Introduction to OAuth 2.0CIS13: Introduction to OAuth 2.0
CIS13: Introduction to OAuth 2.0
 
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
 
API, Integration, and SOA Convergence
API, Integration, and SOA ConvergenceAPI, Integration, and SOA Convergence
API, Integration, and SOA Convergence
 
OAuth with Salesforce - Demystified
OAuth with Salesforce - DemystifiedOAuth with Salesforce - Demystified
OAuth with Salesforce - Demystified
 
Webapp security (with notes)
Webapp security (with notes)Webapp security (with notes)
Webapp security (with notes)
 
Stateless Auth using OAUTH2 & JWT
Stateless Auth using OAUTH2 & JWTStateless Auth using OAUTH2 & JWT
Stateless Auth using OAUTH2 & JWT
 
OAuth for QuickBooks Online REST Services
OAuth for QuickBooks Online REST ServicesOAuth for QuickBooks Online REST Services
OAuth for QuickBooks Online REST Services
 
OAuth2 Introduction
OAuth2 IntroductionOAuth2 Introduction
OAuth2 Introduction
 
OAuth 2.0 for Web and Native (Mobile) App Developers
OAuth 2.0 for Web and Native (Mobile) App DevelopersOAuth 2.0 for Web and Native (Mobile) App Developers
OAuth 2.0 for Web and Native (Mobile) App Developers
 
O auth2 with angular js
O auth2 with angular jsO auth2 with angular js
O auth2 with angular js
 
Id fiware upm-dit
Id fiware  upm-ditId fiware  upm-dit
Id fiware upm-dit
 
CIS13: Identity as a Matter of Public Safety: A Case Study in Secure API Acce...
CIS13: Identity as a Matter of Public Safety: A Case Study in Secure API Acce...CIS13: Identity as a Matter of Public Safety: A Case Study in Secure API Acce...
CIS13: Identity as a Matter of Public Safety: A Case Study in Secure API Acce...
 
Google APIs
Google APIsGoogle APIs
Google APIs
 
Stateless authentication for microservices - Spring I/O 2015
Stateless authentication for microservices  - Spring I/O 2015Stateless authentication for microservices  - Spring I/O 2015
Stateless authentication for microservices - Spring I/O 2015
 
API Management and Mobile App Enablement
API Management and Mobile App EnablementAPI Management and Mobile App Enablement
API Management and Mobile App Enablement
 

Recently uploaded

Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...SUHANI PANDEY
 
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.soniya singh
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Servicesexy call girls service in goa
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersDamian Radcliffe
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...singhpriety023
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)Delhi Call girls
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Call Girls in Nagpur High Profile
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...SUHANI PANDEY
 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubaikojalkojal131
 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...SUHANI PANDEY
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.soniya singh
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024APNIC
 
Al Barsha Night Partner +0567686026 Call Girls Dubai
Al Barsha Night Partner +0567686026 Call Girls  DubaiAl Barsha Night Partner +0567686026 Call Girls  Dubai
Al Barsha Night Partner +0567686026 Call Girls DubaiEscorts Call Girls
 
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.soniya singh
 

Recently uploaded (20)

Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
 
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
 
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
 
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 
Al Barsha Night Partner +0567686026 Call Girls Dubai
Al Barsha Night Partner +0567686026 Call Girls  DubaiAl Barsha Night Partner +0567686026 Call Girls  Dubai
Al Barsha Night Partner +0567686026 Call Girls Dubai
 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
 
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
 

Securing APIs using OAuth 2.0

  • 1. 1 SecuringAPIsusingOAuth Adam Lewis – Motorola Solutions – Chief Technology Office Securing APIs using OAuth 2.0
  • 4. 4 SecuringAPIsusingOAuth Most of these APIs will need to know some very fundamental things: who is the user of the API, and what are they authorized to do?
  • 5. 5 SecuringAPIsusingOAuth In the Beginning … I have an APII would like to use your API to get access to my user’s protected resources I cannot just give you that information. To prove that user really wants to you To access their information, I need their username & password Please give me your username & password so that I can access your resources on your behalf Here is my username & password (Please be good with it) webapp
  • 6. 6 SecuringAPIsusingOAuth And that was bad. Bad. BAD. (very bad!)
  • 7. 7 SecuringAPIsusingOAuth The Password “anti-pattern” Users became promiscuous with their passwords, handing them over directly to any API client that asked for them Client might not be trustworthy Even if the client is trustworthy, it might not be secure and might inadvertently leak the user’s password or be otherwise prone to attack If a password is compromised, or if the client was rogue to begin with, then the only way to revoke that client’s ability to access the user’s resources would be for the user to change their password And because many other clients have also stored the user’s password to access other resource on behalf of the user, those clients also lose their ability to access resources. Finally, giving a third party client access to primary credentials enables the client to access ALL of user’s information, rather than just a scope of it. For example, a user might wish to allow a third-party client to access their Facebook photos, but not to access their Facebook posts. Or they might allow the client to read their posts, but not make posts on their behalf.
  • 9. 9 SecuringAPIsusingOAuth Defined by the IETF There was a version 1.0 before it – But it required client-side crypto, developers didn’t like it – 2.0 takes community feedback into account (more on that later)
  • 10. 10 SecuringAPIsusingOAuth OAuth gives the user the ability to delegate an authorization decision to an API client to access their protected resources without divulging their credentials to that API client Upon granting the API client authorization, the API client is issued an access token, representing scope of that authorization Both API clients and API servers are abstracted from requiring a password (really BIG deal!)
  • 12. 12 SecuringAPIsusingOAuth User logs into web page Redirect user’s browser to authorization endpoint OAuth Authorization Request (requested scope of authorization) User Authentication Happens Here Redirect user’s browser back to web app (API client) with authorization code code Token Request (authorization_code) Token Response (access_token) https://server.com?photos (access token) “webapp” is requesting access to the following resources within your account: do you whish to grant this access? Yes! webapp
  • 13. 13 SecuringAPIsusingOAuth User logs into web page Redirect user’s browser to authorization endpoint OAuth Authorization Request (response_type=code) User Authentication Happens Here Redirect user’s browser back to web app (API client) with authorization code code Token Request (authorization_code) Token Response (access_token) https://server.com?photos (access token) GET https://server.example.com/authorize?response_type=code& client_id=s6BhdRkqt3&redirect_uri=https://client.example.com/cb &scope=calendar.read_only HTTP/1.1 302 Found Location: https://client.example.com/cb?code=SplxlOBeZQQYbYS6WxSbIA &state=xyz POST /token HTTP/1.1 Host: server.example.com Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW Content-Type: application/x-www-form-urlencoded grant_type=authorization_code&code=SplxlOBeZQQYbYS6WxSbIA &redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb HTTP/1.1 200 OK Content-Type: application/json;charset=UTF-8 Cache-Control: no-store Pragma: no-cache { "access_token":"2YotnFZFEjr1zCsicMWpAA", "token_type":"example", "expires_in":3600, "refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA", "example_parameter":"example_value" } “webapp” is requesting access to the following resources within your account: do you whish to grant this access? Yes! webapp
  • 15. 15 SecuringAPIsusingOAuth About that Token • Bearer – whoever holds it may use it – Original OAuth utilized client-side crypto, but developers didn’t exactly flock to it – Bearer tokens were a compromise: better than giving passwords to API clients, less secure than client-side signing • Structure undefined, but in practice: – Opaque (requires introspection) – JWT • kid, x5t • Can be embedded in other protocols besides HTTP (SIP, RTSP, etc.)
  • 16. 16 SecuringAPIsusingOAuth JSON Web Tokens { "alg": "RS256", "x5t": "eZsobkgyfNGOyVpjEHgS2i8QhKQ" }. { "Username": “alice@domain.com", "exp": 1432744471, "scope": [ “calendar_api.read_only“, “contacts.read_only”, “email.all” ], "client_id": "s6BhdRkqt3" }. U4cL9RFKu_CwdqlpGReAVGA5sxw8d8tLXM4_1Cx7l49KQxeHYkV2ARlv6Qo7sdUSv7k50yhNPR80wFx0WqqtoLY AKSJ2sXhfqbVTEZrUdDFZUVVYeKOWEyZzZD1w3NCqRm6xhLWmOu05A4gLDUuC7jWagMYquZPywW06SFX FTa5MN0Nyol3V-QfrFf-XdXTBBUko00ooQf6SsyTcAP08kLuWIl9M2oRLPF_N_f5j1I4oAk5LUMFhdNyGeQ32K- aU_kLoGxzb20eUlsZVO82zm-94tEdeKZWtp6BtwLICc9wvR1DnMJje7O_dOql1L1DYXNrJ0s7rWRlLwAxthbytww
  • 17. 17 SecuringAPIsusingOAuth User launches Native App Redirect user’s browser to authorization endpoint OAuth Authorization Request (response_type=code) User Authentication Happens Here Redirect user’s browser back to web app (API client) with authorization code code Token Request (authorization_code) Token Response (access_token) https://server.com?photos (access token) Native App
  • 18. 18 SecuringAPIsusingOAuth User launches Native App Redirect user’s browser to authorization endpoint OAuth Authorization Request (response_type=code) User Authentication Happens Here Redirect user’s browser back to API client with authorization code code Token Request (authorization_code) Token Response (access_token) https://server.com?photos (access token) Native App SAML request SAML response SAML assertion
  • 19. 19 SecuringAPIsusingOAuth Other WG efforts • Proof of Possession • New grant types (SAML, JWT) • Usage beyond REST • Building block for OpenID Connect, NAPPS
  • 20. 20 SecuringAPIsusingOAuth But the grass isn’t all green • 1.0 was a protocol, 2.0 is a “Framework” • Flexibility == Complicated • Interoperability issues • No standardized access token format • Not well understood • It’s NOT for authentication • Clients often ask for to broad of a scope
  • 21. 21 SecuringAPIsusingOAuth But it’s still really good • Clients never see user credentials • Resource owners can approve only a limited scope • Very developer friendly • Options underway for even higher security
  • 22. 22 SecuringAPIsusingOAuth And in Closing … • Questions? • Comments? • Scrutiny? • Thank you! :-) adam.lewis@motorolasolutions.com

Editor's Notes

  1. WebApp
  2. WebApp
  3. SAML
  4. SAML