SlideShare une entreprise Scribd logo
1  sur  34
Kirsten Jones, Technical Leader, Cisco Systems
   HTTP Overview
   REST Web Services
   OAuth Authentication
   HyperText Transfer Protocol
   Used for conversations between web clients
    and servers
   Most of the internet uses HTTP
   Supports verbs for GET, PUT, POST, DELETE
   Query parameter framework
   Client sends a request
       Method
       URL
       Headers
       (sometimes) parameters
       (sometimes) body
   Server replies with a response
     Content
     Status
     Headers
HTTP response codes for dummies.
 50x: we fucked up.
 40x: you fucked up.
 30x: ask that dude over there.
 20x: cool.


Props to @DanaDanger for that one
   Chrome browser sends a request to Google
     Method: GET
     URL: http://www.google.com
     Headers:
      ▪ Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
      ▪ Accept-Language: en-US,en;q=0.8
      ▪ Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
      ▪ Connection: keep-alive
      ▪ User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3)
        AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.168 Safari/535.19
      ▪ Accept-Encoding: gzip,deflate,sdch
      ▪ Cookie: NID=59=EudJ2a15ql8832PCysQA0qchtuvGWMoA7rkp79VpIYAQ8-
        j42IO17LFudCYNMXm9l6SHcu3YgrGRCdrRCyM468xPZaOek4Pi-
        AXQ8eARqU1SGYx6y7_9LW-c3HHb-vs2;
        PREF=ID=994f8de0e8b39a5b:U=237805f1f710dc73:FF=0:TM=1336752507:LM=13
        36752509:S=W0Hha7x4czdXp51U
      ▪ Host: www.google.com
   Google sends a response
     Headers:
      ▪ Content-Length: 24716
      ▪ Content-Encoding: gzip
      ▪ Set-Cookie: NID=59=F48kbwfwOi-qCHJyrnMSUlDBVxK-
        ZVKZpq5B5jttt_25IRN4lS-0rQcVttq-
        dnOIlQzafw1i4HPQAO0RpZ7NuC0WCKWta7SYoekx0--YGf2zIFZ9VXIKS-
        _UEaOH9iBe; expires=Sat, 10-Nov-2012 21:26:46 GMT; path=/;
        domain=.google.com; HttpOnly
      ▪ Expires: -1
      ▪ Server: gws
      ▪ X-XSS-Protection: 1; mode=block
      ▪ Cache-Control: private, max-age=0
      ▪ X-Frame-Options: SAMEORIGIN
      ▪ Content-Type: text/html; charset=UTF-8
      ▪ Date: Fri, 11 May 2012 21:26:46 GMT
     Content: A bunch of HTML
     Status: 200
   Macintosh: HTTPScoop
    http://tuffcode.com/

   Macintosh: Charles (supports SSL)
    http://www.charlesproxy.com/

   Windows: Fiddler
    http://www.fiddler2.com/fiddler2/

   Unix (or Mac): Wireshark (X11)
    http://www.wireshark.org/
Request
Headers
Request/Response
   Uses URL paths to define resources
   Create, Read, Update, Delete
     POST, GET, PUT, DELETE
   Error Codes
     HTTP Status Codes
   Request parameters
     Query parameters
   Response types and configuration
     Headers
   Blog Info from Tumblr
   GET (read)
    http://api.tumblr.com/v2/blog/synedra.tumbl
    er.com/info
   Requires api_key sent as parameter
   Headers
   Request/Response
Status: 200
Content:
{"meta":
   {"status":200, "msg":"OK” },
 "response":{
    "blog":{"title":"Untitled","posts":0,
            "name":"synedra",
            "url":"http://synedra.tumblr.com/",
            "updated":0,
            "description":"","ask":false,"likes":0}}}
   Monitor application use
   Know which users are making requests
   Prevent DDOS attacks on the system
 Used by many APIs
 Each application gets a consumer key and secret
 Authentication server handles authentication
 Each user of an application gets a unique user
  token and secret
 Supports tracking of application/member use of
  the API
 Allows users to protect username/password
 Industry standard – libraries for most
  programming languages
   REST web services call adds verification
    signature to each request
   Query parameters
     Authorization header
   Secrets are used to create signature
   Authentication server checks signature to
    verify that it was created using shared secrets
   If authentication succeeds, request is
    processed by API server
   Signature is generated based on
       URL
       Parameters
       Consumer key
       User token
   http://api.linkedin.com/v1/people/url=http%3A%2F%2Fw
    ww.linkedin.com%2Fin%2Fsynedra?oauth_body_hash=2j
    mj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D&oauth_nonce
    =6283929&oauth_timestamp=1336775605&oauth_consu
    mer_key=***KEY***&oauth_signature_method=HMAC-
    SHA1&oauth_version=1.0&oauth_token=***TOKEN***
    &oauth_signature=CqHiZI6tI3pQGe5a0vVgoT0822A%3D
   Request
   Headers (nothing special)
   Request/Response
   Signature is generated based on
       URL
       Parameters
       Consumer key
       User token
 URL is unchanged:
  http://api.linkedin.com/v1/people/~/shares
 Authorization header has oauth stuff:
  OAuth realm="http://api.linkedin.com",
  oauth_body_hash="JtgCKBurLIPLM4dXkn2E3lgrfI4%3D",
  oauth_nonce="60723468", oauth_timestamp="1336776657",
  oauth_consumer_key=”***KEY***",
  oauth_signature_method="HMAC-SHA1", oauth_version="1.0",
  oauth_token=”***TOKEN***",
  oauth_signature="8iWVpIK3LhRbu8JPf2gzC1YxQy4%3D"
   No authorization parameters
   Authorization is in the header
   Request/response works the same
   How to use PECL OAuth to sign API requests
   http://pecl.php.net/package/oauth
   Quick walkthrough to understand process
    (but this talk is not about Oauth)
   First step in OAuth: Get a request token for
    this authorization session
   OAuth library handles signing the request
   Second step: Send the user to the server to
    authorize your application
   After the user authorizes your
    application, the server returns a verification
    code for you to use
   Third step: Use the verifier and the request
    token to get an access token
   This is a long lived token
   Make an API call using the OAuth library
   The library handles the signature generation
   HTTP: Hypertext Transfer Protocol
   REST: REpresentational State Transfer
   OAuth: Authentication

Contenu connexe

Tendances

Cross site calls with javascript - the right way with CORS
Cross site calls with javascript - the right way with CORSCross site calls with javascript - the right way with CORS
Cross site calls with javascript - the right way with CORSMichael Neale
 
Building Secure User Interfaces With JWTs (JSON Web Tokens)
Building Secure User Interfaces With JWTs (JSON Web Tokens)Building Secure User Interfaces With JWTs (JSON Web Tokens)
Building Secure User Interfaces With JWTs (JSON Web Tokens)Stormpath
 
WSO2Con USA 2015: Securing your APIs: Patterns and More
WSO2Con USA 2015: Securing your APIs: Patterns and MoreWSO2Con USA 2015: Securing your APIs: Patterns and More
WSO2Con USA 2015: Securing your APIs: Patterns and MoreWSO2
 
Mitigate Maliciousness -- jQuery Europe 2013
Mitigate Maliciousness -- jQuery Europe 2013Mitigate Maliciousness -- jQuery Europe 2013
Mitigate Maliciousness -- jQuery Europe 2013Mike West
 
Practical django secuirty
Practical django secuirtyPractical django secuirty
Practical django secuirtyAndy Dai
 
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise securityMuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise securityakashdprajapati
 
REST is bad - Kfir Bloch - OpenStack Day Israel 2017
REST is bad - Kfir Bloch - OpenStack Day Israel 2017REST is bad - Kfir Bloch - OpenStack Day Israel 2017
REST is bad - Kfir Bloch - OpenStack Day Israel 2017Cloud Native Day Tel Aviv
 
Web Security - Cookies, Domains and CORS
Web Security - Cookies, Domains and CORSWeb Security - Cookies, Domains and CORS
Web Security - Cookies, Domains and CORSPerfectial, LLC
 
FI-WARE Account and OAuth solution
FI-WARE Account and OAuth solutionFI-WARE Account and OAuth solution
FI-WARE Account and OAuth solutionJavier Cerviño
 
Penetration Testing Report
Penetration Testing ReportPenetration Testing Report
Penetration Testing ReportAman Srivastava
 
01. http basics v27
01. http basics v2701. http basics v27
01. http basics v27Eoin Keary
 
CORS - Enable Alfresco for CORS
CORS - Enable Alfresco for CORSCORS - Enable Alfresco for CORS
CORS - Enable Alfresco for CORSJared Ottley
 
PHP Experience 2016 - [Palestra] Json Web Token (JWT)
PHP Experience 2016 - [Palestra] Json Web Token (JWT)PHP Experience 2016 - [Palestra] Json Web Token (JWT)
PHP Experience 2016 - [Palestra] Json Web Token (JWT)iMasters
 
Reverse proxies & Inconsistency
Reverse proxies & InconsistencyReverse proxies & Inconsistency
Reverse proxies & InconsistencyGreenD0g
 
Weird proxies/2 and a bit of magic
 Weird proxies/2 and a bit of magic  Weird proxies/2 and a bit of magic
Weird proxies/2 and a bit of magic GreenD0g
 
HTTP For the Good or the Bad - FSEC Edition
HTTP For the Good or the Bad - FSEC EditionHTTP For the Good or the Bad - FSEC Edition
HTTP For the Good or the Bad - FSEC EditionXavier Mertens
 
Comparative Development Methodologies
Comparative Development MethodologiesComparative Development Methodologies
Comparative Development Methodologieselliando dias
 
Tecnologias Open Source para Alta Disponibilidade e Segurança de Aplicações Web
Tecnologias Open Source para  Alta Disponibilidade e Segurança de Aplicações WebTecnologias Open Source para  Alta Disponibilidade e Segurança de Aplicações Web
Tecnologias Open Source para Alta Disponibilidade e Segurança de Aplicações WebAlexandro Silva
 

Tendances (20)

Cross site calls with javascript - the right way with CORS
Cross site calls with javascript - the right way with CORSCross site calls with javascript - the right way with CORS
Cross site calls with javascript - the right way with CORS
 
Building Secure User Interfaces With JWTs (JSON Web Tokens)
Building Secure User Interfaces With JWTs (JSON Web Tokens)Building Secure User Interfaces With JWTs (JSON Web Tokens)
Building Secure User Interfaces With JWTs (JSON Web Tokens)
 
WSO2Con USA 2015: Securing your APIs: Patterns and More
WSO2Con USA 2015: Securing your APIs: Patterns and MoreWSO2Con USA 2015: Securing your APIs: Patterns and More
WSO2Con USA 2015: Securing your APIs: Patterns and More
 
Mitigate Maliciousness -- jQuery Europe 2013
Mitigate Maliciousness -- jQuery Europe 2013Mitigate Maliciousness -- jQuery Europe 2013
Mitigate Maliciousness -- jQuery Europe 2013
 
Practical django secuirty
Practical django secuirtyPractical django secuirty
Practical django secuirty
 
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise securityMuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
 
IdM and AC
IdM and ACIdM and AC
IdM and AC
 
REST is bad - Kfir Bloch - OpenStack Day Israel 2017
REST is bad - Kfir Bloch - OpenStack Day Israel 2017REST is bad - Kfir Bloch - OpenStack Day Israel 2017
REST is bad - Kfir Bloch - OpenStack Day Israel 2017
 
Rest is bad
Rest is badRest is bad
Rest is bad
 
Web Security - Cookies, Domains and CORS
Web Security - Cookies, Domains and CORSWeb Security - Cookies, Domains and CORS
Web Security - Cookies, Domains and CORS
 
FI-WARE Account and OAuth solution
FI-WARE Account and OAuth solutionFI-WARE Account and OAuth solution
FI-WARE Account and OAuth solution
 
Penetration Testing Report
Penetration Testing ReportPenetration Testing Report
Penetration Testing Report
 
01. http basics v27
01. http basics v2701. http basics v27
01. http basics v27
 
CORS - Enable Alfresco for CORS
CORS - Enable Alfresco for CORSCORS - Enable Alfresco for CORS
CORS - Enable Alfresco for CORS
 
PHP Experience 2016 - [Palestra] Json Web Token (JWT)
PHP Experience 2016 - [Palestra] Json Web Token (JWT)PHP Experience 2016 - [Palestra] Json Web Token (JWT)
PHP Experience 2016 - [Palestra] Json Web Token (JWT)
 
Reverse proxies & Inconsistency
Reverse proxies & InconsistencyReverse proxies & Inconsistency
Reverse proxies & Inconsistency
 
Weird proxies/2 and a bit of magic
 Weird proxies/2 and a bit of magic  Weird proxies/2 and a bit of magic
Weird proxies/2 and a bit of magic
 
HTTP For the Good or the Bad - FSEC Edition
HTTP For the Good or the Bad - FSEC EditionHTTP For the Good or the Bad - FSEC Edition
HTTP For the Good or the Bad - FSEC Edition
 
Comparative Development Methodologies
Comparative Development MethodologiesComparative Development Methodologies
Comparative Development Methodologies
 
Tecnologias Open Source para Alta Disponibilidade e Segurança de Aplicações Web
Tecnologias Open Source para  Alta Disponibilidade e Segurança de Aplicações WebTecnologias Open Source para  Alta Disponibilidade e Segurança de Aplicações Web
Tecnologias Open Source para Alta Disponibilidade e Segurança de Aplicações Web
 

Similaire à Demystifying REST

20190516 web security-basic
20190516 web security-basic20190516 web security-basic
20190516 web security-basicMksYi
 
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
 
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
 
HTTP fundamentals for developers
HTTP fundamentals for developersHTTP fundamentals for developers
HTTP fundamentals for developersMario Cardinal
 
Pentesting web applications
Pentesting web applicationsPentesting web applications
Pentesting web applicationsSatish b
 
KMUTNB - Internet Programming 2/7
KMUTNB - Internet Programming 2/7KMUTNB - Internet Programming 2/7
KMUTNB - Internet Programming 2/7phuphax
 
Introduction to OAuth
Introduction to OAuthIntroduction to OAuth
Introduction to OAuthPaul Osman
 
OAuth 2 at Webvisions
OAuth 2 at WebvisionsOAuth 2 at Webvisions
OAuth 2 at WebvisionsAaron Parecki
 
Automating Cloud Operations: Everything You Wanted to Know about cURL and REST
Automating Cloud Operations: Everything You Wanted to Know about cURL and RESTAutomating Cloud Operations: Everything You Wanted to Know about cURL and REST
Automating Cloud Operations: Everything You Wanted to Know about cURL and RESTRevelation Technologies
 
02 banking trojans-thomassiebert
02 banking trojans-thomassiebert02 banking trojans-thomassiebert
02 banking trojans-thomassiebertgeeksec80
 
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
[CB16] Esoteric Web Application Vulnerabilities by Andrés RianchoCODE BLUE
 
OAuth2 Authentication
OAuth2 AuthenticationOAuth2 Authentication
OAuth2 AuthenticationIsmael Costa
 
HTTP/2 What's inside and Why
HTTP/2 What's inside and WhyHTTP/2 What's inside and Why
HTTP/2 What's inside and WhyAdrian Cole
 
Defeating Cross-Site Scripting with Content Security Policy (updated)
Defeating Cross-Site Scripting with Content Security Policy (updated)Defeating Cross-Site Scripting with Content Security Policy (updated)
Defeating Cross-Site Scripting with Content Security Policy (updated)Francois Marier
 
Pentesting RESTful webservices
Pentesting RESTful webservicesPentesting RESTful webservices
Pentesting RESTful webservicesMohammed A. Imran
 

Similaire à Demystifying REST (20)

20190516 web security-basic
20190516 web security-basic20190516 web security-basic
20190516 web security-basic
 
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...
 
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!
 
HTTP fundamentals for developers
HTTP fundamentals for developersHTTP fundamentals for developers
HTTP fundamentals for developers
 
Pentesting web applications
Pentesting web applicationsPentesting web applications
Pentesting web applications
 
KMUTNB - Internet Programming 2/7
KMUTNB - Internet Programming 2/7KMUTNB - Internet Programming 2/7
KMUTNB - Internet Programming 2/7
 
Introduction to OAuth
Introduction to OAuthIntroduction to OAuth
Introduction to OAuth
 
gofortution
gofortutiongofortution
gofortution
 
OAuth 2 at Webvisions
OAuth 2 at WebvisionsOAuth 2 at Webvisions
OAuth 2 at Webvisions
 
HTTP
HTTPHTTP
HTTP
 
Presentation (PPT)
Presentation (PPT)Presentation (PPT)
Presentation (PPT)
 
Automating Cloud Operations: Everything You Wanted to Know about cURL and REST
Automating Cloud Operations: Everything You Wanted to Know about cURL and RESTAutomating Cloud Operations: Everything You Wanted to Know about cURL and REST
Automating Cloud Operations: Everything You Wanted to Know about cURL and REST
 
02 banking trojans-thomassiebert
02 banking trojans-thomassiebert02 banking trojans-thomassiebert
02 banking trojans-thomassiebert
 
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
 
OAuth2 Authentication
OAuth2 AuthenticationOAuth2 Authentication
OAuth2 Authentication
 
HTTP/2 What's inside and Why
HTTP/2 What's inside and WhyHTTP/2 What's inside and Why
HTTP/2 What's inside and Why
 
Defeating Cross-Site Scripting with Content Security Policy (updated)
Defeating Cross-Site Scripting with Content Security Policy (updated)Defeating Cross-Site Scripting with Content Security Policy (updated)
Defeating Cross-Site Scripting with Content Security Policy (updated)
 
OAuth 2.0
OAuth 2.0OAuth 2.0
OAuth 2.0
 
Pentesting RESTful webservices
Pentesting RESTful webservicesPentesting RESTful webservices
Pentesting RESTful webservices
 

Plus de Kirsten Hunter

Plus de Kirsten Hunter (20)

Git store
Git storeGit store
Git store
 
Polyglot copy
Polyglot copyPolyglot copy
Polyglot copy
 
Quantifying your-fitness
Quantifying your-fitnessQuantifying your-fitness
Quantifying your-fitness
 
Api intensive - What they Are
Api intensive - What they AreApi intensive - What they Are
Api intensive - What they Are
 
Designing irresistible apis
Designing irresistible apisDesigning irresistible apis
Designing irresistible apis
 
Api 101
Api 101Api 101
Api 101
 
Designing irresistible apis
Designing irresistible apisDesigning irresistible apis
Designing irresistible apis
 
Api 101
Api 101Api 101
Api 101
 
Designing irresistible APIs
Designing irresistible APIsDesigning irresistible APIs
Designing irresistible APIs
 
API First
API FirstAPI First
API First
 
API 101 Workshop from APIStrat Conference
API 101 Workshop from APIStrat ConferenceAPI 101 Workshop from APIStrat Conference
API 101 Workshop from APIStrat Conference
 
Liberating your data
Liberating your dataLiberating your data
Liberating your data
 
Liberating your data
Liberating your dataLiberating your data
Liberating your data
 
API 101 - Understanding APIs.
API 101 - Understanding APIs.API 101 - Understanding APIs.
API 101 - Understanding APIs.
 
Demystifying REST - SFRails meetup
Demystifying REST - SFRails meetupDemystifying REST - SFRails meetup
Demystifying REST - SFRails meetup
 
Quantifying fitness
Quantifying fitnessQuantifying fitness
Quantifying fitness
 
Prototyping in the cloud
Prototyping in the cloudPrototyping in the cloud
Prototyping in the cloud
 
Designing for developers
Designing for developersDesigning for developers
Designing for developers
 
Facebook appsincloud
Facebook appsincloudFacebook appsincloud
Facebook appsincloud
 
Rest schema design
Rest schema designRest schema design
Rest schema design
 

Dernier

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 

Dernier (20)

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Demystifying REST

  • 1. Kirsten Jones, Technical Leader, Cisco Systems
  • 2. HTTP Overview  REST Web Services  OAuth Authentication
  • 3. HyperText Transfer Protocol  Used for conversations between web clients and servers  Most of the internet uses HTTP  Supports verbs for GET, PUT, POST, DELETE  Query parameter framework
  • 4. Client sends a request  Method  URL  Headers  (sometimes) parameters  (sometimes) body  Server replies with a response  Content  Status  Headers
  • 5. HTTP response codes for dummies.  50x: we fucked up.  40x: you fucked up.  30x: ask that dude over there.  20x: cool. Props to @DanaDanger for that one
  • 6. Chrome browser sends a request to Google  Method: GET  URL: http://www.google.com  Headers: ▪ Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 ▪ Accept-Language: en-US,en;q=0.8 ▪ Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 ▪ Connection: keep-alive ▪ User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.168 Safari/535.19 ▪ Accept-Encoding: gzip,deflate,sdch ▪ Cookie: NID=59=EudJ2a15ql8832PCysQA0qchtuvGWMoA7rkp79VpIYAQ8- j42IO17LFudCYNMXm9l6SHcu3YgrGRCdrRCyM468xPZaOek4Pi- AXQ8eARqU1SGYx6y7_9LW-c3HHb-vs2; PREF=ID=994f8de0e8b39a5b:U=237805f1f710dc73:FF=0:TM=1336752507:LM=13 36752509:S=W0Hha7x4czdXp51U ▪ Host: www.google.com
  • 7. Google sends a response  Headers: ▪ Content-Length: 24716 ▪ Content-Encoding: gzip ▪ Set-Cookie: NID=59=F48kbwfwOi-qCHJyrnMSUlDBVxK- ZVKZpq5B5jttt_25IRN4lS-0rQcVttq- dnOIlQzafw1i4HPQAO0RpZ7NuC0WCKWta7SYoekx0--YGf2zIFZ9VXIKS- _UEaOH9iBe; expires=Sat, 10-Nov-2012 21:26:46 GMT; path=/; domain=.google.com; HttpOnly ▪ Expires: -1 ▪ Server: gws ▪ X-XSS-Protection: 1; mode=block ▪ Cache-Control: private, max-age=0 ▪ X-Frame-Options: SAMEORIGIN ▪ Content-Type: text/html; charset=UTF-8 ▪ Date: Fri, 11 May 2012 21:26:46 GMT  Content: A bunch of HTML  Status: 200
  • 8. Macintosh: HTTPScoop http://tuffcode.com/  Macintosh: Charles (supports SSL) http://www.charlesproxy.com/  Windows: Fiddler http://www.fiddler2.com/fiddler2/  Unix (or Mac): Wireshark (X11) http://www.wireshark.org/
  • 12. Uses URL paths to define resources  Create, Read, Update, Delete  POST, GET, PUT, DELETE  Error Codes  HTTP Status Codes  Request parameters  Query parameters  Response types and configuration  Headers
  • 13. Blog Info from Tumblr  GET (read) http://api.tumblr.com/v2/blog/synedra.tumbl er.com/info  Requires api_key sent as parameter
  • 14.
  • 15. Headers
  • 16. Request/Response
  • 17. Status: 200 Content: {"meta": {"status":200, "msg":"OK” }, "response":{ "blog":{"title":"Untitled","posts":0, "name":"synedra", "url":"http://synedra.tumblr.com/", "updated":0, "description":"","ask":false,"likes":0}}}
  • 18. Monitor application use  Know which users are making requests  Prevent DDOS attacks on the system
  • 19.  Used by many APIs  Each application gets a consumer key and secret  Authentication server handles authentication  Each user of an application gets a unique user token and secret  Supports tracking of application/member use of the API  Allows users to protect username/password  Industry standard – libraries for most programming languages
  • 20. REST web services call adds verification signature to each request  Query parameters  Authorization header  Secrets are used to create signature  Authentication server checks signature to verify that it was created using shared secrets  If authentication succeeds, request is processed by API server
  • 21. Signature is generated based on  URL  Parameters  Consumer key  User token  http://api.linkedin.com/v1/people/url=http%3A%2F%2Fw ww.linkedin.com%2Fin%2Fsynedra?oauth_body_hash=2j mj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D&oauth_nonce =6283929&oauth_timestamp=1336775605&oauth_consu mer_key=***KEY***&oauth_signature_method=HMAC- SHA1&oauth_version=1.0&oauth_token=***TOKEN*** &oauth_signature=CqHiZI6tI3pQGe5a0vVgoT0822A%3D
  • 22. Request
  • 23. Headers (nothing special)
  • 24. Request/Response
  • 25. Signature is generated based on  URL  Parameters  Consumer key  User token  URL is unchanged: http://api.linkedin.com/v1/people/~/shares  Authorization header has oauth stuff: OAuth realm="http://api.linkedin.com", oauth_body_hash="JtgCKBurLIPLM4dXkn2E3lgrfI4%3D", oauth_nonce="60723468", oauth_timestamp="1336776657", oauth_consumer_key=”***KEY***", oauth_signature_method="HMAC-SHA1", oauth_version="1.0", oauth_token=”***TOKEN***", oauth_signature="8iWVpIK3LhRbu8JPf2gzC1YxQy4%3D"
  • 26. No authorization parameters
  • 27. Authorization is in the header
  • 28. Request/response works the same
  • 29. How to use PECL OAuth to sign API requests  http://pecl.php.net/package/oauth  Quick walkthrough to understand process (but this talk is not about Oauth)
  • 30. First step in OAuth: Get a request token for this authorization session  OAuth library handles signing the request
  • 31. Second step: Send the user to the server to authorize your application  After the user authorizes your application, the server returns a verification code for you to use
  • 32. Third step: Use the verifier and the request token to get an access token  This is a long lived token
  • 33. Make an API call using the OAuth library  The library handles the signature generation
  • 34. HTTP: Hypertext Transfer Protocol  REST: REpresentational State Transfer  OAuth: Authentication