SlideShare a Scribd company logo
© 2015 IBM Corporation
REST API support for Cross-Origin Resource Sharing (CORS)
IBM Streams Version 4.1
Janet Weber
InfoSphere Streams Development
For questions about this presentation contact Janet Weber
jeweber@us.ibm.com
2 © 2015 IBM Corporation
Important Disclaimer
THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL
PURPOSES ONLY.
WHILE EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE
INFORMATION CONTAINED IN THIS PRESENTATION, IT IS PROVIDED “AS IS”, WITHOUT WARRANTY
OF ANY KIND, EXPRESS OR IMPLIED.
IN ADDITION, THIS INFORMATION IS BASED ON IBM’S CURRENT PRODUCT PLANS AND STRATEGY,
WHICH ARE SUBJECT TO CHANGE BY IBM WITHOUT NOTICE.
IBM SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OR
OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION.
NOTHING CONTAINED IN THIS PRESENTATION IS INTENDED TO, OR SHALL HAVE THE EFFECT OF:
• CREATING ANY WARRANTY OR REPRESENTATION FROM IBM (OR ITS AFFILIATES OR ITS OR
THEIR SUPPLIERS AND/OR LICENSORS); OR
• ALTERING THE TERMS AND CONDITIONS OF THE APPLICABLE LICENSE AGREEMENT
GOVERNING THE USE OF IBM SOFTWARE.
IBM’s statements regarding its plans, directions, and intent are subject to change or
withdrawal without notice at IBM’s sole discretion. Information regarding potential
future products is intended to outline our general product direction and it should not
be relied on in making a purchasing decision. The information mentioned regarding
potential future products is not a commitment, promise, or legal obligation to deliver
any material, code or functionality. Information about potential future products may
not be incorporated into any contract. The development, release, and timing of any
future features or functionality described for our products remains at our sole
discretion.
THIS INFORMATION IS BASED ON IBM’S CURRENT PRODUCT PLANS AND STRATEGY, WHICH ARE SUBJECT TO CHANGE BY IBM WITHOUT NOTICE.
IBM SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION.
3 © 2015 IBM Corporation
Agenda
 Cross Origin Resource Sharing (CORS) overview
 How to make cross-origin requests to the Streams REST API
 Demo
 Additional considerations
 Questions
4 © 2015 IBM Corporation
High-Level Overview
 Same origin policy – Web browsers prevent scripts from retrieving data from
a different host or a different port than used to serve the page containing the
script
 This means you could not make make Streams REST API calls from a script
 Streams 4.1 added cross-origin resource sharing (CORS) support to address
this restriction
 CORS – mechanism for browser and server to work together to determine
whether to allow cross-origin requests
 Streams uses a new configuration setting to determine which requests to
allow
5 © 2015 IBM Corporation
Making a Cross-origin Request
1. Make sure your browser supports CORS
1. Configure the list of trusted origins (streamtool, domain console, JMX)
streamtool addtrustedorigin-d domainName http://myhost.com:1234
1. Ensure the Streams server certificate is trusted by the browser
1. Make the cross-origin request
var xhr = new XMLHttpRequest();
xhr.withCrendentials = true;
xhr.open('GET', 'https://myhost.com:8443/streams/rest/resources');
xhr.setRequestHeader('Authorization','Basic ' + btoa('user:password'));
xhr.send()
6 © 2015 IBM Corporation
Demo
7 © 2015 IBM Corporation
Considerations
 Browser support
– Some browsers had limited support in earlier releases and more complete
support in newer releases
– Some browsers impose addition security restrictions on cross-origin requests
 Trusted origins
– Includes the scheme, host, port
– Exact match to HTTP Origin header value
• Can view with browser's debugger
– Can add multiple entries to handle different options
• Default port: http://host.com and http://host.com:8080
• Host identifier: http://host.com:5678 and http://1.2.3.4:5678
 Product documentation
http://www.ibm.com/support/knowledgecenter/SSCRJU_4.1.0/
com.ibm.streams.dev.doc/doc/restapi-cfgcors.html
 Streamsdev article coming soon
8 © 2015 IBM Corporation
Questions?
9 © 2015 IBM Corporation
10 © 2015 IBM Corporation
Demo Screenshots
Firefox – Server certificate not trusted
11 © 2015 IBM Corporation
Demo Screenshots
Firefox – Origin not in trusted list
12 © 2015 IBM Corporation
Demo Screenshots
Firefox – Origin not in trusted list
13 © 2015 IBM Corporation
Demo Screenshots
Firefox – Successful request with preflight

More Related Content

PDF
IBM Streams V4.1 and User Authentication with Client Certificates
PDF
IBM Streams V4.1 and JAAS Login Module Support
PDF
IBM Streams V4.1 and Incremental Checkpointing
PDF
Security Authentication and Authorization Service (AAS) for IBM InfoSphere St...
PDF
Consistent Regions in Specialized Toolkits for IBM InfoSphere Streams V4.0
PDF
IBM Streams V4.1 Integration with IBM Platform Symphony
PDF
IBM Streams Getting Started Resources
PDF
Installation and Setup for IBM InfoSphere Streams V4.0
IBM Streams V4.1 and User Authentication with Client Certificates
IBM Streams V4.1 and JAAS Login Module Support
IBM Streams V4.1 and Incremental Checkpointing
Security Authentication and Authorization Service (AAS) for IBM InfoSphere St...
Consistent Regions in Specialized Toolkits for IBM InfoSphere Streams V4.0
IBM Streams V4.1 Integration with IBM Platform Symphony
IBM Streams Getting Started Resources
Installation and Setup for IBM InfoSphere Streams V4.0

What's hot (17)

PDF
IBM Streams V4.2 Submission Time Fusion and Configuration
PDF
IBM Streams IoT Integration
PDF
Highlights of the Telecommunications Event Data Analytics toolkit
PDF
Non-Blocking Checkpointing for Consistent Regions in IBM Streams V4.2.
PDF
Streaming Analytics for Bluemix Enhancements
PDF
IBM ODM Rules Compiler support in IBM Streams V4.2.
PDF
What's New in IBM Streams V4.2
PDF
Deploy, Monitor and Manage in Style with WebSphere Liberty Admin Center
PPTX
Microsoft App-V 5.1 and Flexera AdminStudio Webinar
PPTX
CLI319 Microsoft Desktop Optimization Pack: Planning the Deployment of Micros...
PDF
Easi Sms Enterprise Solutions Brochure
PPTX
EasiSMS Desktop Messaging
PDF
MATRIX License Comparison
DOCX
Mobile crm installation & configuration details
PDF
Datasheet webspheremessagebroker midvisionextensionforibmraf
PPT
WebSphere sMash June Product Review
PDF
Microsoft exchange-2010-2013-iapp-dg
IBM Streams V4.2 Submission Time Fusion and Configuration
IBM Streams IoT Integration
Highlights of the Telecommunications Event Data Analytics toolkit
Non-Blocking Checkpointing for Consistent Regions in IBM Streams V4.2.
Streaming Analytics for Bluemix Enhancements
IBM ODM Rules Compiler support in IBM Streams V4.2.
What's New in IBM Streams V4.2
Deploy, Monitor and Manage in Style with WebSphere Liberty Admin Center
Microsoft App-V 5.1 and Flexera AdminStudio Webinar
CLI319 Microsoft Desktop Optimization Pack: Planning the Deployment of Micros...
Easi Sms Enterprise Solutions Brochure
EasiSMS Desktop Messaging
MATRIX License Comparison
Mobile crm installation & configuration details
Datasheet webspheremessagebroker midvisionextensionforibmraf
WebSphere sMash June Product Review
Microsoft exchange-2010-2013-iapp-dg
Ad

Viewers also liked (7)

PDF
Togaf 9 overview
PDF
TOGAF 9 Methodology Ver1 0
PDF
TOGAF 9 Architectural Artifacts
PPTX
Learn Togaf 9.1 in 100 slides!
PDF
ZooKeeper and Embedded ZooKeeper Support for IBM InfoSphere Streams V4.0
PDF
Grading procedures google slides presentation
PPTX
Harshad kas[1]
Togaf 9 overview
TOGAF 9 Methodology Ver1 0
TOGAF 9 Architectural Artifacts
Learn Togaf 9.1 in 100 slides!
ZooKeeper and Embedded ZooKeeper Support for IBM InfoSphere Streams V4.0
Grading procedures google slides presentation
Harshad kas[1]
Ad

Similar to IBM Streams V4.1 REST API Support for Cross-Origin Resource Sharing (CORS) (20)

PDF
Data Governance with IBM Streams V4.1
PDF
Administration APIs: REST and JMX for IBM InfoSphere Streams V4.0
PDF
PDF
SHARE2016: DevOps - IIB Administration for Continuous Delivery and DevOps
PDF
Csaix install
PPT
Using WebSphere MQ with WebSphere Application Server and the Liberty Profile
PPTX
DEV-1269: Best and Worst Practices for Deploying IBM Connections – IBM Conne...
PDF
What's New in Toolkits for IBM Streams V4.1
PDF
Informix REST API Tutorial
ODP
2829 liberty
ODP
AD506: IBM Connect 2014. IBM Sametime Proxy 9: A fuller, richer customizable ...
PDF
What's New with Anypoint Platform? Unified Platform Management
PDF
APIC/DataPower security
PPTX
Why z/OS is a great platform for developing and hosting APIs
PDF
Exposing auto-generated Swagger 2.0 documents from Liberty!
PDF
Become an IBM Cloud Architect in 40 Minutes
PDF
Enterprise grade cloud services with data power virtual
PDF
Enterprise grade cloud services with data power virtual
PPTX
Rapid Deployments of IBM WebSphere ND at Scale
PDF
IBM Message Hub: Cloud-Native Messaging
Data Governance with IBM Streams V4.1
Administration APIs: REST and JMX for IBM InfoSphere Streams V4.0
SHARE2016: DevOps - IIB Administration for Continuous Delivery and DevOps
Csaix install
Using WebSphere MQ with WebSphere Application Server and the Liberty Profile
DEV-1269: Best and Worst Practices for Deploying IBM Connections – IBM Conne...
What's New in Toolkits for IBM Streams V4.1
Informix REST API Tutorial
2829 liberty
AD506: IBM Connect 2014. IBM Sametime Proxy 9: A fuller, richer customizable ...
What's New with Anypoint Platform? Unified Platform Management
APIC/DataPower security
Why z/OS is a great platform for developing and hosting APIs
Exposing auto-generated Swagger 2.0 documents from Liberty!
Become an IBM Cloud Architect in 40 Minutes
Enterprise grade cloud services with data power virtual
Enterprise grade cloud services with data power virtual
Rapid Deployments of IBM WebSphere ND at Scale
IBM Message Hub: Cloud-Native Messaging

More from lisanl (15)

PDF
What's New Overview for IBM Streams V4.3
PDF
SPL Event-Time Processing in IBM Streams V4.3
PDF
Option Data Types in IBM Streams V4.3
PDF
Dynamic and Elastic Scaling in IBM Streams V4.3
PDF
Toolkits Overview for IBM Streams V4.2
PDF
Github Projects Overview and IBM Streams V4.1
PDF
Introduction to IBM Platform Symphony Integration with IBM Streams V4.1
PDF
What's New in IBM Streams V4.1
PDF
What's New in the Streams Console in IBM Streams V4.1
PDF
Expanding beyond SPL -- More language support in IBM Streams V4.1
PDF
Introduction to the Spark MLLib Toolkit in IBM Streams V4.1
PDF
An Overview of IBM Streaming Analytics for Bluemix
PDF
What's New in the Timeseries Toolkit for IBM InfoSphere Streams V4.0
PDF
Streams Studio Support for IBM InfoSphere Streams V4.0
PDF
Streams GitHub Products Overview for IBM InfoSphere Streams V4.0
What's New Overview for IBM Streams V4.3
SPL Event-Time Processing in IBM Streams V4.3
Option Data Types in IBM Streams V4.3
Dynamic and Elastic Scaling in IBM Streams V4.3
Toolkits Overview for IBM Streams V4.2
Github Projects Overview and IBM Streams V4.1
Introduction to IBM Platform Symphony Integration with IBM Streams V4.1
What's New in IBM Streams V4.1
What's New in the Streams Console in IBM Streams V4.1
Expanding beyond SPL -- More language support in IBM Streams V4.1
Introduction to the Spark MLLib Toolkit in IBM Streams V4.1
An Overview of IBM Streaming Analytics for Bluemix
What's New in the Timeseries Toolkit for IBM InfoSphere Streams V4.0
Streams Studio Support for IBM InfoSphere Streams V4.0
Streams GitHub Products Overview for IBM InfoSphere Streams V4.0

Recently uploaded (20)

PDF
Mega Projects Data Mega Projects Data
PPTX
Acceptance and paychological effects of mandatory extra coach I classes.pptx
PPTX
oil_refinery_comprehensive_20250804084928 (1).pptx
PPTX
Database Infoormation System (DBIS).pptx
PPTX
1_Introduction to advance data techniques.pptx
PDF
Fluorescence-microscope_Botany_detailed content
PPT
Reliability_Chapter_ presentation 1221.5784
PDF
.pdf is not working space design for the following data for the following dat...
PPTX
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
PDF
Clinical guidelines as a resource for EBP(1).pdf
PDF
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
PPTX
STUDY DESIGN details- Lt Col Maksud (21).pptx
PPTX
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
PPTX
Business Ppt On Nestle.pptx huunnnhhgfvu
PPTX
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
PPTX
Introduction to machine learning and Linear Models
PPTX
Data_Analytics_and_PowerBI_Presentation.pptx
PPTX
climate analysis of Dhaka ,Banglades.pptx
PPTX
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
PDF
Galatica Smart Energy Infrastructure Startup Pitch Deck
Mega Projects Data Mega Projects Data
Acceptance and paychological effects of mandatory extra coach I classes.pptx
oil_refinery_comprehensive_20250804084928 (1).pptx
Database Infoormation System (DBIS).pptx
1_Introduction to advance data techniques.pptx
Fluorescence-microscope_Botany_detailed content
Reliability_Chapter_ presentation 1221.5784
.pdf is not working space design for the following data for the following dat...
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
Clinical guidelines as a resource for EBP(1).pdf
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
STUDY DESIGN details- Lt Col Maksud (21).pptx
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
Business Ppt On Nestle.pptx huunnnhhgfvu
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
Introduction to machine learning and Linear Models
Data_Analytics_and_PowerBI_Presentation.pptx
climate analysis of Dhaka ,Banglades.pptx
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
Galatica Smart Energy Infrastructure Startup Pitch Deck

IBM Streams V4.1 REST API Support for Cross-Origin Resource Sharing (CORS)

  • 1. © 2015 IBM Corporation REST API support for Cross-Origin Resource Sharing (CORS) IBM Streams Version 4.1 Janet Weber InfoSphere Streams Development For questions about this presentation contact Janet Weber jeweber@us.ibm.com
  • 2. 2 © 2015 IBM Corporation Important Disclaimer THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY. WHILE EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE INFORMATION CONTAINED IN THIS PRESENTATION, IT IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. IN ADDITION, THIS INFORMATION IS BASED ON IBM’S CURRENT PRODUCT PLANS AND STRATEGY, WHICH ARE SUBJECT TO CHANGE BY IBM WITHOUT NOTICE. IBM SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION. NOTHING CONTAINED IN THIS PRESENTATION IS INTENDED TO, OR SHALL HAVE THE EFFECT OF: • CREATING ANY WARRANTY OR REPRESENTATION FROM IBM (OR ITS AFFILIATES OR ITS OR THEIR SUPPLIERS AND/OR LICENSORS); OR • ALTERING THE TERMS AND CONDITIONS OF THE APPLICABLE LICENSE AGREEMENT GOVERNING THE USE OF IBM SOFTWARE. IBM’s statements regarding its plans, directions, and intent are subject to change or withdrawal without notice at IBM’s sole discretion. Information regarding potential future products is intended to outline our general product direction and it should not be relied on in making a purchasing decision. The information mentioned regarding potential future products is not a commitment, promise, or legal obligation to deliver any material, code or functionality. Information about potential future products may not be incorporated into any contract. The development, release, and timing of any future features or functionality described for our products remains at our sole discretion. THIS INFORMATION IS BASED ON IBM’S CURRENT PRODUCT PLANS AND STRATEGY, WHICH ARE SUBJECT TO CHANGE BY IBM WITHOUT NOTICE. IBM SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION.
  • 3. 3 © 2015 IBM Corporation Agenda  Cross Origin Resource Sharing (CORS) overview  How to make cross-origin requests to the Streams REST API  Demo  Additional considerations  Questions
  • 4. 4 © 2015 IBM Corporation High-Level Overview  Same origin policy – Web browsers prevent scripts from retrieving data from a different host or a different port than used to serve the page containing the script  This means you could not make make Streams REST API calls from a script  Streams 4.1 added cross-origin resource sharing (CORS) support to address this restriction  CORS – mechanism for browser and server to work together to determine whether to allow cross-origin requests  Streams uses a new configuration setting to determine which requests to allow
  • 5. 5 © 2015 IBM Corporation Making a Cross-origin Request 1. Make sure your browser supports CORS 1. Configure the list of trusted origins (streamtool, domain console, JMX) streamtool addtrustedorigin-d domainName http://myhost.com:1234 1. Ensure the Streams server certificate is trusted by the browser 1. Make the cross-origin request var xhr = new XMLHttpRequest(); xhr.withCrendentials = true; xhr.open('GET', 'https://myhost.com:8443/streams/rest/resources'); xhr.setRequestHeader('Authorization','Basic ' + btoa('user:password')); xhr.send()
  • 6. 6 © 2015 IBM Corporation Demo
  • 7. 7 © 2015 IBM Corporation Considerations  Browser support – Some browsers had limited support in earlier releases and more complete support in newer releases – Some browsers impose addition security restrictions on cross-origin requests  Trusted origins – Includes the scheme, host, port – Exact match to HTTP Origin header value • Can view with browser's debugger – Can add multiple entries to handle different options • Default port: http://host.com and http://host.com:8080 • Host identifier: http://host.com:5678 and http://1.2.3.4:5678  Product documentation http://www.ibm.com/support/knowledgecenter/SSCRJU_4.1.0/ com.ibm.streams.dev.doc/doc/restapi-cfgcors.html  Streamsdev article coming soon
  • 8. 8 © 2015 IBM Corporation Questions?
  • 9. 9 © 2015 IBM Corporation
  • 10. 10 © 2015 IBM Corporation Demo Screenshots Firefox – Server certificate not trusted
  • 11. 11 © 2015 IBM Corporation Demo Screenshots Firefox – Origin not in trusted list
  • 12. 12 © 2015 IBM Corporation Demo Screenshots Firefox – Origin not in trusted list
  • 13. 13 © 2015 IBM Corporation Demo Screenshots Firefox – Successful request with preflight