SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Semelhante a 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
 

Semelhante a 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
 

Mais de Kirsten Hunter

Mais 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
 

Último

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 

Último (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 

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