Prabath Siriwardena
Senior Architect & Chair, Integration MC

          Johann Nallathamby
   Software Engineer, Integration MC
Securing APIs
Securing APIs
AWS	
  Signature	
  -­‐	
  1	
  

•  Split	
  the	
  query	
  string	
  based	
  on	
  '&'	
  and	
  '='	
  characters	
  into	
  a	
  series	
  of	
  key-­‐value	
  pairs.	
  
•  Sort	
  the	
  pairs	
  based	
  on	
  the	
  keys.	
  
•  Append	
  the	
  keys	
  and	
  values	
  together,	
  in	
  order,	
  to	
  construct	
  one	
  big	
  string	
  (key1	
  +	
  
   value1	
  +	
  key2	
  +	
  value2	
  +	
  ...	
  ).	
  
•  Sign	
  that	
  string	
  using	
  HMAC-­‐SHA1	
  and	
  your	
  secret	
  access	
  key.	
  
AWS	
  Signature	
  -­‐	
  2	
  

•  You	
  include	
  additional	
  components	
  of	
  the	
  request	
  in	
  the	
  string	
  to	
  sign	
  
•  You	
  include	
  the	
  query	
  string	
  control	
  parameters	
  (the	
  equals	
  signs	
  and	
  ampersands)	
  in	
  the	
  
   string	
  to	
  sign	
  
•  You	
  sort	
  the	
  query	
  string	
  parameters	
  using	
  byte	
  ordering	
  
•  You	
  URL	
  encode	
  the	
  query	
  string	
  parameters	
  and	
  their	
  values	
  before	
  signing	
  the	
  request	
  
•  You	
  can	
  use	
  HMAC-­‐SHA256	
  when	
  you	
  sign	
  the	
  request	
  (we	
  prefer	
  HMAC-­‐SHA256,	
  but	
  we	
  still	
  
   support	
  HMAC-­‐SHA1)	
  
•  You	
  must	
  set	
  the	
  SignatureMethod	
  request	
  parameter	
  to	
  either	
  HmacSHA256	
  or	
  HmacSHA1	
  
   to	
  indicate	
  which	
  signing	
  method	
  you're	
  using	
  
•  You	
  must	
  set	
  the	
  SignatureVersion	
  request	
  parameter	
  to	
  2	
  
http://s3.amazonaws.com/doc/s3-­‐developer-­‐guide/RESTAuthentication.html	
  
http://blog.programmableweb.com/2010/08/16/twitter-­‐basic-­‐auth-­‐will-­‐truly-­‐disappear-­‐august-­‐30/	
  
Securing APIs
Third-­‐party	
  applications	
  are	
  required	
  to	
  store	
  the	
  resource	
  
owner's	
  credentials	
  for	
  future	
  use,	
  typically	
  a	
  password	
  in	
  clear-­‐
                                       text.	
  
Servers	
  are	
  required	
  to	
  support	
  password	
  authentication,	
  
 despite	
  the	
  security	
  weaknesses	
  created	
  by	
  passwords.	
  
Third-­‐party	
  applications	
  gain	
  overly	
  broad	
  access	
  to	
  the	
  
resource	
  owner's	
  protected	
  resources,	
  leaving	
  resource	
  owners	
  
  without	
  any	
  ability	
  to	
  restrict	
  duration	
  or	
  access	
  to	
  a	
  limited	
  
                                subset	
  of	
  resources.	
  
Resource	
  owners	
  cannot	
  revoke	
  access	
  to	
  an	
  individual	
  third-­‐
party	
  without	
  revoking	
  access	
  to	
  all	
  third-­‐parties,	
  and	
  must	
  do	
  
                     so	
  by	
  changing	
  their	
  password.	
  
Compromise	
  of	
  any	
  third-­‐party	
  application	
  results	
  in	
  
compromise	
  of	
  the	
  end-­‐user's	
  password	
  and	
  all	
  of	
  the	
  data	
  
                protected	
  by	
  that	
  password.	
  
http://www.flickr.com/services/api/misc.userauth.html	
  
Securing APIs
Securing APIs
Securing APIs
Securing APIs
Securing APIs
Securing APIs
http://oauth.googlecode.com/svn/spec/ext/consumer_request/1.0/drafts/2/spec.html	
  
http://oauth.googlecode.com/svn/spec/ext/consumer_request/1.0/drafts/2/spec.html	
  
•  Complexity	
  in	
  validating	
  and	
  generating	
  signatures.	
  
•  No	
  clear	
  separation	
  between	
  Resource	
  Server	
  and	
  
   Authorization	
  Server.	
  
•  Browser	
  based	
  re-­‐redirections.	
  
Securing APIs
BasicAuth	
  




                OAuth	
  Handshake	
  
BasicAuth	
  




OAuth	
  Handshake	
  
Runtime	
  
Bearer	
                   MAC	
  




             Runtime	
  
Bearer	
                                       MAC	
  




                                            Bearer	
  
Any	
  party	
  in	
  possession	
  of	
  a	
  bearer	
  token	
  (a	
  "bearer")	
  can	
  use	
  
       it	
  to	
  get	
  access	
  to	
  the	
  associated	
  resources	
  (without	
  
        demonstrating	
  possession	
  of	
  a	
  cryptographic	
  key).	
  



                                         Runtime	
  
Request	
  with	
  Bearer	
  




GET	
  /resource/1	
  HTTP/1.1	
  
Host:	
  example.com	
  
Authorization:	
  Bearer	
  “access_token_value”	
  




           http://tools.ietf.org/html/draft-­‐ietf-­‐oauth-­‐v2-­‐bearer-­‐20	
  



                                        Runtime	
  
Bearer	
                            MAC	
  




                        MAC	
  
 HTTP	
  MAC	
  access	
  authentication	
  scheme	
  




                    Runtime	
  
Request	
  with	
  MAC	
  




GET	
  /resource/1	
  HTTP/1.1	
  
Host:	
  example.com	
  
	
  Authorization:	
  MAC	
  id="h480djs93hd8",	
  
                                                                          	
                                                                           	
  	
  	
  	
  	
  	
  ts="1336363200"	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  nonce="274312:dj83hs9s",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  mac="kDZvddkndxvhGRXZhvuDjEWhGeE="	
  

                               http://tools.ietf.org/html/draft-­‐ietf-­‐oauth-­‐v2-­‐http-­‐mac-­‐01	
  



                                                                                                         Runtime	
  
Securing APIs

More Related Content

PDF
ESB Evaluation Framework
PPT
Understanding Platform as a Service
PDF
Monitoring API Performance and Delivering a Scalable API Solution
PDF
Introducing the WSO2 Elastic Load Balancer
PDF
Better Enterprise Integration With the WSO2 ESB 4.5.1
PDF
PPTX
Cloud Foundry Roadmap (Cloud Foundry Summit 2014)
PDF
[WSO2Con EU 2017] Container-native Architecture
ESB Evaluation Framework
Understanding Platform as a Service
Monitoring API Performance and Delivering a Scalable API Solution
Introducing the WSO2 Elastic Load Balancer
Better Enterprise Integration With the WSO2 ESB 4.5.1
Cloud Foundry Roadmap (Cloud Foundry Summit 2014)
[WSO2Con EU 2017] Container-native Architecture

What's hot (15)

PDF
Deep-dive into WSO2 ESB 5.0
PPTX
Microservices in the Apache Kafka Ecosystem
PDF
Integrating Alfresco @ Scale (via event-driven micro-services)
 
PPTX
Azure appservice
PDF
Microservices for Enterprises
PPTX
Camel Based Development Application
PDF
Cloud Development with Camel and Amazon Web Services
PPTX
Sitecore JSS at scale
PPTX
Resilient Enterprise Messaging with WSO2 ESB
PPTX
Don't Get Schooled: Performance and Security Tips from a Leading Education Sa...
PPTX
Overview of Rest Service and ASP.NET WEB API
PPTX
From Monolith to Microservices using Amazon EC2 Container Service
PPT
WSO2-ESB - The backbone of Enterprise Integration
PDF
Kafka Pluggable Authorization for Enterprise Security (Anna Kepler, Viasat) K...
PDF
How to build a custom stack with WSO2 carbon
Deep-dive into WSO2 ESB 5.0
Microservices in the Apache Kafka Ecosystem
Integrating Alfresco @ Scale (via event-driven micro-services)
 
Azure appservice
Microservices for Enterprises
Camel Based Development Application
Cloud Development with Camel and Amazon Web Services
Sitecore JSS at scale
Resilient Enterprise Messaging with WSO2 ESB
Don't Get Schooled: Performance and Security Tips from a Leading Education Sa...
Overview of Rest Service and ASP.NET WEB API
From Monolith to Microservices using Amazon EC2 Container Service
WSO2-ESB - The backbone of Enterprise Integration
Kafka Pluggable Authorization for Enterprise Security (Anna Kepler, Viasat) K...
How to build a custom stack with WSO2 carbon
Ad

Similar to Securing APIs (20)

PDF
Distributed Identities with OpenID
PDF
Distributed Identities with OpenID
PPTX
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
PPTX
OAuth - Don’t Throw the Baby Out with the Bathwater
PPTX
OpenID Connect Demo at OpenID Tech Night
PDF
Twitter oauth #idcon7
PDF
When and Why Would I use Oauth2?
PPTX
Saas webinar-dec6-01
PPT
Oauth tutorial
PDF
Draft Hammer Oauth 10
PDF
OpenID and OAuth
PDF
Securing Your API
PPT
Oauth
PPTX
Enterprise Access Control Patterns for Rest and Web APIs
PDF
RFC6749 et alia 20130504
PDF
Draft Ietf Oauth V2 12
PPTX
Making Sense of API Access Control
PDF
OAuth2 on Ericsson Labs
PDF
OAuth and OEmbed
PPTX
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
Distributed Identities with OpenID
Distributed Identities with OpenID
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
OAuth - Don’t Throw the Baby Out with the Bathwater
OpenID Connect Demo at OpenID Tech Night
Twitter oauth #idcon7
When and Why Would I use Oauth2?
Saas webinar-dec6-01
Oauth tutorial
Draft Hammer Oauth 10
OpenID and OAuth
Securing Your API
Oauth
Enterprise Access Control Patterns for Rest and Web APIs
RFC6749 et alia 20130504
Draft Ietf Oauth V2 12
Making Sense of API Access Control
OAuth2 on Ericsson Labs
OAuth and OEmbed
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
Ad

More from WSO2 (20)

PDF
Demystifying CMS-0057-F - Compliance Made Seamless with WSO2
PDF
Quantum Threats Are Closer Than You Think – Act Now to Stay Secure
PDF
Modern Platform Engineering with Choreo - The AI-Native Internal Developer Pl...
PDF
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
PDF
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
PDF
Platformless Modernization with Choreo.pdf
PDF
Application Modernization with Choreo for the BFSI Sector
PDF
Choreo - The AI-Native Internal Developer Platform as a Service: Overview
PDF
[Roundtable] Choreo - The AI-Native Internal Developer Platform as a Service
PPTX
WSO2Con 2025 - Building AI Applications in the Enterprise (Part 1)
PPTX
WSO2Con 2025 - Building Secure Business Customer and Partner Experience (B2B)...
PPTX
WSO2Con 2025 - Building Secure Customer Experience Apps
PPTX
WSO2Con 2025 - AI-Driven API Design, Development, and Consumption with Enhanc...
PPTX
WSO2Con 2025 - AI-Driven API Design, Development, and Consumption with Enhanc...
PPTX
WSO2Con 2025 - Unified Management of Ingress and Egress Across Multiple API G...
PPTX
WSO2Con 2025 - How an Internal Developer Platform Lets Developers Focus on Code
PPTX
WSO2Con 2025 - Architecting Cloud-Native Applications
PDF
Mastering Intelligent Digital Experiences with Platformless Modernization
PDF
Accelerate Enterprise Software Engineering with Platformless
PDF
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
Demystifying CMS-0057-F - Compliance Made Seamless with WSO2
Quantum Threats Are Closer Than You Think – Act Now to Stay Secure
Modern Platform Engineering with Choreo - The AI-Native Internal Developer Pl...
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
Platformless Modernization with Choreo.pdf
Application Modernization with Choreo for the BFSI Sector
Choreo - The AI-Native Internal Developer Platform as a Service: Overview
[Roundtable] Choreo - The AI-Native Internal Developer Platform as a Service
WSO2Con 2025 - Building AI Applications in the Enterprise (Part 1)
WSO2Con 2025 - Building Secure Business Customer and Partner Experience (B2B)...
WSO2Con 2025 - Building Secure Customer Experience Apps
WSO2Con 2025 - AI-Driven API Design, Development, and Consumption with Enhanc...
WSO2Con 2025 - AI-Driven API Design, Development, and Consumption with Enhanc...
WSO2Con 2025 - Unified Management of Ingress and Egress Across Multiple API G...
WSO2Con 2025 - How an Internal Developer Platform Lets Developers Focus on Code
WSO2Con 2025 - Architecting Cloud-Native Applications
Mastering Intelligent Digital Experiences with Platformless Modernization
Accelerate Enterprise Software Engineering with Platformless
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation

Securing APIs