SlideShare a Scribd company logo
oauth-for-credentials-security-in-rest-api-access
Open Authorization :
OAuth for credentials security in REST API access
Panggi Libersa Jasri Akadol
Web : http://www.opensecuritylab.org
Twitter : @panggi
Agenda
• Web 2.0 and Data
• OAuth usage
• Useful resources
Web 2.0 and Data
Web 2.0
= Your Data
Different service = Different data
What if
you need to use your data that stored in
another service provider’s server ?
Yup , just take it 
oauth-for-credentials-security-in-rest-api-access
OK .. Enough with the Cute creatures :-p
Let’s dive into technical things
Once again.. How ?
Using API (Application Programming Interface)
An application programming interface (API)
is an interface implemented by a software program that enables it to interact with other software.
It facilitates interaction between different software programs similar to the way the user interface
facilitates interaction between humans and computers. ( via http://en.wikipedia.org/wiki/API)
oauth-for-credentials-security-in-rest-api-access
REST Representational State Transfer
•Provide every resource with a unique ID, for example, a URI
•Link resources with each other, establishing relationships among resources
•Use standard methods (HTTP, media types, XML)
•Resources can have multiple representations that reflect different application states
•The communication should be stateless using the HTTP
Accessing API
oauth-for-credentials-security-in-rest-api-access
oauth-for-credentials-security-in-rest-api-access
What’s on your mind ?
"Giving your email account password
to a social network site so they can look
up your friends is the same thing as
going to dinner and giving your ATM card
and PIN code to the waiter when it’s time
to pay."
- oauth.net
we need an easy,
user-friendly standard
for third party api security
OAuth usage
oauth-for-credentials-security-in-rest-api-access
OAuth puts the user
back in control
You choose who you share
your data with
OAuth is secure
No need to give
Username and
Password
Big Name Adoption
Google Yahoo!
OpenSocial Netflix
MySpace twitter
SmugMug GetSatisfaction and more...
Love triangle
End user
(Resource Owner)
Service provider
Consumer
OAuth
OAuth
Protected resources
are exposed by service providers
and used by consumer applications
on behalf of users
OAuth
My Twitter Status
Is exposed by Twitter
And used by Seesmic
On my behalf
OAuth Terminology
• Provider is the application that exposes the secure API and user’s identity
• Consumer is the application that is written against the Provider’s API, intended
for Provider’s users.
• Users or resource owners are registered users of the Provider
• Consumer Key is an identifier for the consumer
• Consumer Secret is a shared-secret between the provider and the consumer
• Signature Methods are encryption methods used by OAuth communication.
Methods suggested are PLAINTEXT, RSA-SHA1 and HMAC-SHA1
• OAuth Endpoints are endpoints exposed by the provider to facilitate OAuth
dance
• Callback URL is an endpoint at the Consumer that is invoked by the Provider
once the user authorizes the Consumer. If none, the value is oob, or Out-of-
Band
Tokens
• Request Token
– Short lived identifiers which start the handshake
– Must be converted to Access Token in order to gain access
to a user’s resources
• Access Token
– Long lived identifiers that are tied to the user’s identity
– Are used to access a user’s resources (data) at the Provider
on behalf of the user
Endpoints
• Get request token
• Authorize token
• Get access token
Get Request Token
• The endpoint provides consumers to get an unauthorized
request token by providing their consumer key and other
parameters as a signed request
• The credentials can be passed via HTTP Header, POST body or
GET QueryString
• The request includes an oauth_signature which is calculated
by following the steps defined in the spec. Use libraries
instead of writing your own signing implementations.
• The response has an unauthorized request token as well as a
token secret, and a flag indicating if the callback was
accepted.
Authorize Token
• The step authorizes an unauthorized request token retrieved
via previous request.
• The endpoint takes the unauthorized request token – or the
user can enter one manually if supported.
• The Authorize Token endpoint then redirects the user to the
Provider’s login page
• The user logs in, and is asked to authorize the consumer (and
hence the request token)
• Once the user authenticates, and authorizes access to the
consumer, the provider calls the callback URL provided earlier
with a verifier code. This verifier code, along with other
credentials is used to get an Access Token.
Get Access Token
• At this step, the now authorized request token is exchanged
for an access token
• The access token acts as a user’s credential for any further
transactions
• The endpoint takes the request token and the verifier code
returned via the callback, or manually if callback is not
supported. The request is signed with consumer secret and
the request token’s secret.
• The Provider returns an access token and a token secret.
• The token secret is used to sign the requests along with the
consumer secret.
Access User’s Resources
• Now that the consumer has the access token,
the user’s resources can be requested via
signed requests to the provider.
• The user should be able to unauthorize the
consumer by revoking the access token.
• The access token has a time to live which is
typically longer than the request token
Useful Resources
• http://tools.ietf.org/html/rfc5849
• http://oauth.net/code/
• http://hueniverse.com/oauth/
• http://code.google.com/p/oauth/
• http://opensecuritylab.org/tag/oauth

More Related Content

PDF
eWise at FinDEVr
PPTX
Digital signature and adv payment gateway
PPT
IDoT: Challenges from the IDentities of Things Landscape
PDF
ForgeRock Open banking - Meetup 28/06/2018
PPTX
Digital signature & PKI Infrastructure
PDF
Identity Platform Use Cases
PPTX
What Is The Blockchain kyc solutions
PPTX
Digital signature and certificate authority
eWise at FinDEVr
Digital signature and adv payment gateway
IDoT: Challenges from the IDentities of Things Landscape
ForgeRock Open banking - Meetup 28/06/2018
Digital signature & PKI Infrastructure
Identity Platform Use Cases
What Is The Blockchain kyc solutions
Digital signature and certificate authority

What's hot (18)

PDF
Using Strong / Verified Identities
PDF
Digital Locker Requester Api Specification v1 0
PDF
Wallet mobile-ui-presentation
PPT
Re-using existing PKIs for online Identity Management
PDF
White-Label Mobile Payments System
PDF
Exploring the Possibilities of Blockchain in Healthcare
PDF
Technical Specifications DLTS ver 2.3
PDF
Digital Locker Dedicated Repository Api Specification v1 4
PDF
eSign Brochure1.5
PPT
What is Digital Signature, Digital Signature FAQ - eMudhra
PDF
Automated E-Pin Generator in Banking Sector
DOCX
Bank chain to leverage blockchain further
PPTX
Digital signature certificate provider in delhi
PDF
Blockchain Account Aggregation oct 2019 rev nci
PDF
DSC E-Sign File Attachment
PDF
Implementing Open Banking with ForgeRock
PDF
Infographic: Designing next-gen Digital Banking, powered by Open Banking API’...
Using Strong / Verified Identities
Digital Locker Requester Api Specification v1 0
Wallet mobile-ui-presentation
Re-using existing PKIs for online Identity Management
White-Label Mobile Payments System
Exploring the Possibilities of Blockchain in Healthcare
Technical Specifications DLTS ver 2.3
Digital Locker Dedicated Repository Api Specification v1 4
eSign Brochure1.5
What is Digital Signature, Digital Signature FAQ - eMudhra
Automated E-Pin Generator in Banking Sector
Bank chain to leverage blockchain further
Digital signature certificate provider in delhi
Blockchain Account Aggregation oct 2019 rev nci
DSC E-Sign File Attachment
Implementing Open Banking with ForgeRock
Infographic: Designing next-gen Digital Banking, powered by Open Banking API’...
Ad

Similar to oauth-for-credentials-security-in-rest-api-access (20)

PPT
Silicon Valley Code Camp 2009: OAuth: What, Why and How
PPTX
Oauth2 and OWSM OAuth2 support
PPTX
An introduction to OAuth 2
PPTX
Intro to OAuth2 and OpenID Connect
PPTX
OAuth
PPTX
Best Practices in Building an API Security Ecosystem
PPTX
OAuth2 Implementation Presentation (Java)
PDF
Learn with WSO2 - API Security
PPTX
OAuth2 + API Security
PPTX
Maintest 100713212237-phpapp02-100714080303-phpapp02
PPTX
Maintest 100713212237-phpapp02-100714080303-phpapp02
PDF
Deep Dive into OAuth for Connected Apps
PPTX
OAuth [noddyCha]
PDF
O auth2.0 guide
PPTX
Microservice security with spring security 5.1,Oauth 2.0 and open id connect
PPTX
Api security
PDF
Oauth Php App
PDF
Implementing OAuth with PHP
Silicon Valley Code Camp 2009: OAuth: What, Why and How
Oauth2 and OWSM OAuth2 support
An introduction to OAuth 2
Intro to OAuth2 and OpenID Connect
OAuth
Best Practices in Building an API Security Ecosystem
OAuth2 Implementation Presentation (Java)
Learn with WSO2 - API Security
OAuth2 + API Security
Maintest 100713212237-phpapp02-100714080303-phpapp02
Maintest 100713212237-phpapp02-100714080303-phpapp02
Deep Dive into OAuth for Connected Apps
OAuth [noddyCha]
O auth2.0 guide
Microservice security with spring security 5.1,Oauth 2.0 and open id connect
Api security
Oauth Php App
Implementing OAuth with PHP
Ad

More from idsecconf (20)

PDF
IDSECCONF2024 Capture The FLag Write up - 3 MAS MAS
PDF
IDSECCONF2024 - Rifqi Hilmy Zhafrant - Hunting and Exploiting GraphQL Vulnera...
PDF
IDSECCONF2024 - Arief Karfianto - AI-Enhanced Security Analysis in Requiremen...
PDF
IDSECCONF2024 - Ryan Fabella, Daniel Dhaniswara - Keamanan Siber Pada Kendara...
PDF
IDSECCONF2024 - Angela Oryza - ITS Nabu-Platform Pelatihan Keamanan Siber den...
PDF
IDSECCONF2024 - Rama Tri Nanda - MQTT hacking, RCE in Smart Router.pdf
PDF
IDSECCONF2024 - Muhammad Dwison - The Implementation Of One Pixel Attack To S...
PDF
IDSECCONF2024 - Kang Ali - Local LLM can Simulate Apt Malware With Jailbreak ...
PDF
IDSECCONF2024 - Brian Nasywa - Comparison of Quantum Key Distribution Protoco...
PDF
idsecconf2023 - Mochammad Riyan Firmansyah - Takeover Cloud Managed Router vi...
PDF
idsecconf2023 - Neil Armstrong - Leveraging IaC for Stealthy Infrastructure A...
PDF
idsecconf2023 - Mangatas Tondang, Wahyu Nuryanto - Penerapan Model Detection ...
PDF
idsecconf2023 - Rama Tri Nanda - Hacking Smart Doorbell.pdf
PDF
idsecconf2023 - Akshantula Neha, Mohammad Febri Ramadlan - Cyber Harmony Auto...
PDF
idsecconf2023 - Aan Wahyu - Hide n seek with android app protections and beat...
PDF
idsecconf2023 - Satria Ady Pradana - Launch into the Stratus-phere Adversary ...
PDF
Ali - The Journey-Hack Electron App Desktop (MacOS).pdf
PDF
Muh. Fani Akbar - Infiltrate Into Your AWS Cloud Environment Through Public E...
PDF
Rama Tri Nanda - NFC Hacking Hacking NFC Reverse Power Supply Padlock.pdf
PDF
Arief Karfianto - Proposed Security Model for Protecting Patients Data in Ele...
IDSECCONF2024 Capture The FLag Write up - 3 MAS MAS
IDSECCONF2024 - Rifqi Hilmy Zhafrant - Hunting and Exploiting GraphQL Vulnera...
IDSECCONF2024 - Arief Karfianto - AI-Enhanced Security Analysis in Requiremen...
IDSECCONF2024 - Ryan Fabella, Daniel Dhaniswara - Keamanan Siber Pada Kendara...
IDSECCONF2024 - Angela Oryza - ITS Nabu-Platform Pelatihan Keamanan Siber den...
IDSECCONF2024 - Rama Tri Nanda - MQTT hacking, RCE in Smart Router.pdf
IDSECCONF2024 - Muhammad Dwison - The Implementation Of One Pixel Attack To S...
IDSECCONF2024 - Kang Ali - Local LLM can Simulate Apt Malware With Jailbreak ...
IDSECCONF2024 - Brian Nasywa - Comparison of Quantum Key Distribution Protoco...
idsecconf2023 - Mochammad Riyan Firmansyah - Takeover Cloud Managed Router vi...
idsecconf2023 - Neil Armstrong - Leveraging IaC for Stealthy Infrastructure A...
idsecconf2023 - Mangatas Tondang, Wahyu Nuryanto - Penerapan Model Detection ...
idsecconf2023 - Rama Tri Nanda - Hacking Smart Doorbell.pdf
idsecconf2023 - Akshantula Neha, Mohammad Febri Ramadlan - Cyber Harmony Auto...
idsecconf2023 - Aan Wahyu - Hide n seek with android app protections and beat...
idsecconf2023 - Satria Ady Pradana - Launch into the Stratus-phere Adversary ...
Ali - The Journey-Hack Electron App Desktop (MacOS).pdf
Muh. Fani Akbar - Infiltrate Into Your AWS Cloud Environment Through Public E...
Rama Tri Nanda - NFC Hacking Hacking NFC Reverse Power Supply Padlock.pdf
Arief Karfianto - Proposed Security Model for Protecting Patients Data in Ele...

oauth-for-credentials-security-in-rest-api-access

  • 2. Open Authorization : OAuth for credentials security in REST API access
  • 3. Panggi Libersa Jasri Akadol Web : http://www.opensecuritylab.org Twitter : @panggi
  • 4. Agenda • Web 2.0 and Data • OAuth usage • Useful resources
  • 5. Web 2.0 and Data
  • 8. Different service = Different data
  • 9. What if you need to use your data that stored in another service provider’s server ?
  • 10. Yup , just take it 
  • 12. OK .. Enough with the Cute creatures :-p Let’s dive into technical things
  • 14. Using API (Application Programming Interface)
  • 15. An application programming interface (API) is an interface implemented by a software program that enables it to interact with other software. It facilitates interaction between different software programs similar to the way the user interface facilitates interaction between humans and computers. ( via http://en.wikipedia.org/wiki/API)
  • 17. REST Representational State Transfer •Provide every resource with a unique ID, for example, a URI •Link resources with each other, establishing relationships among resources •Use standard methods (HTTP, media types, XML) •Resources can have multiple representations that reflect different application states •The communication should be stateless using the HTTP
  • 22. "Giving your email account password to a social network site so they can look up your friends is the same thing as going to dinner and giving your ATM card and PIN code to the waiter when it’s time to pay." - oauth.net
  • 23. we need an easy, user-friendly standard for third party api security
  • 26. OAuth puts the user back in control You choose who you share your data with
  • 27. OAuth is secure No need to give Username and Password
  • 28. Big Name Adoption Google Yahoo! OpenSocial Netflix MySpace twitter SmugMug GetSatisfaction and more...
  • 29. Love triangle End user (Resource Owner) Service provider Consumer OAuth
  • 30. OAuth Protected resources are exposed by service providers and used by consumer applications on behalf of users
  • 31. OAuth My Twitter Status Is exposed by Twitter And used by Seesmic On my behalf
  • 32. OAuth Terminology • Provider is the application that exposes the secure API and user’s identity • Consumer is the application that is written against the Provider’s API, intended for Provider’s users. • Users or resource owners are registered users of the Provider • Consumer Key is an identifier for the consumer • Consumer Secret is a shared-secret between the provider and the consumer • Signature Methods are encryption methods used by OAuth communication. Methods suggested are PLAINTEXT, RSA-SHA1 and HMAC-SHA1 • OAuth Endpoints are endpoints exposed by the provider to facilitate OAuth dance • Callback URL is an endpoint at the Consumer that is invoked by the Provider once the user authorizes the Consumer. If none, the value is oob, or Out-of- Band
  • 33. Tokens • Request Token – Short lived identifiers which start the handshake – Must be converted to Access Token in order to gain access to a user’s resources • Access Token – Long lived identifiers that are tied to the user’s identity – Are used to access a user’s resources (data) at the Provider on behalf of the user
  • 34. Endpoints • Get request token • Authorize token • Get access token
  • 35. Get Request Token • The endpoint provides consumers to get an unauthorized request token by providing their consumer key and other parameters as a signed request • The credentials can be passed via HTTP Header, POST body or GET QueryString • The request includes an oauth_signature which is calculated by following the steps defined in the spec. Use libraries instead of writing your own signing implementations. • The response has an unauthorized request token as well as a token secret, and a flag indicating if the callback was accepted.
  • 36. Authorize Token • The step authorizes an unauthorized request token retrieved via previous request. • The endpoint takes the unauthorized request token – or the user can enter one manually if supported. • The Authorize Token endpoint then redirects the user to the Provider’s login page • The user logs in, and is asked to authorize the consumer (and hence the request token) • Once the user authenticates, and authorizes access to the consumer, the provider calls the callback URL provided earlier with a verifier code. This verifier code, along with other credentials is used to get an Access Token.
  • 37. Get Access Token • At this step, the now authorized request token is exchanged for an access token • The access token acts as a user’s credential for any further transactions • The endpoint takes the request token and the verifier code returned via the callback, or manually if callback is not supported. The request is signed with consumer secret and the request token’s secret. • The Provider returns an access token and a token secret. • The token secret is used to sign the requests along with the consumer secret.
  • 38. Access User’s Resources • Now that the consumer has the access token, the user’s resources can be requested via signed requests to the provider. • The user should be able to unauthorize the consumer by revoking the access token. • The access token has a time to live which is typically longer than the request token
  • 40. • http://tools.ietf.org/html/rfc5849 • http://oauth.net/code/ • http://hueniverse.com/oauth/ • http://code.google.com/p/oauth/ • http://opensecuritylab.org/tag/oauth