CORS Essentials

Share code and assets across domains in Web applications with CORS

CORS Essentials

This ebook is included in a Mapt subscription
Rajesh Gunasundaram, Randall Goya

Share code and assets across domains in Web applications with CORS
$0.00
$14.00
$34.99
$29.99p/m after trial
RRP $27.99
RRP $34.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Code Files
Preview in Mapt

Book Details

ISBN 139781784393779
Paperback144 pages

Book Description

This book explains how to use CORS, including specific implementations for platforms such as Drupal, WordPress, IIS Server, ASP.NET, JBoss, Windows Azure, and Salesforce, as well as how to use CORS in the Cloud on Amazon AWS, YouTube, Mulesoft, and others. It examines limitations, security risks, and alternatives to CORS. It explores the W3C Specification and major developer documentation sources about CORS. It attempts to predict what kinds of extension to the CORS specification, or completely new techniques, will come in the future to address the limitations of CORS

Web developers will learn how to share code and assets across domains with CORS. They will learn a variety of techniques that are rather similar in their method and syntax. The book is organized by similar types of framework and application, so it can be used as a reference. Developers will learn about special cases, such as when a proxy is necessary. And they will learn about some alternative techniques that achieve similar goals, and when they may be preferable to using CORS

Table of Contents

Chapter 1: Why You Need CORS
The same-origin policy
Considering the origin of entities
Commonly allowed cross-origin resource sharing
Permissions required by JavaScript
How CORS works – the header and the request
CORS with Preflight
Troubleshooting and debugging CORS
CORS with jQuery
Enabling CORS globally with server configuration
Alternatives to CORS
Summary
Chapter 2: Creating Proxies for CORS
Proxies and the World Wide Web
What is a proxy server?
Reasons to use a proxy
Creating a proxy server with Google App Engine
Summary
Chapter 3: Usability and Security
CORS usability
Enhancing security in CORS
Summary
Chapter 4: CORS in Popular Content Management Frameworks
Incoming CORS requests
SAAS or self-hosted?
CORS in WordPress
CORS in Drupal
CORS in Joomla!
CORS in Adobe Experience Manager
Summary
Chapter 5: CORS in Windows
Incoming CORS requests
How to set the Access-Control-Allow-Origin header globally in Windows IIS Server
CORS in the ASP.NET Web API
CORS in Windows Communication Foundation
CORS in Windows browsers – Internet Explorer and Edge
Summary
Chapter 6: CORS in the Cloud
CORS requests in cloud APIs
CORS in Amazon Simple Storage Service (S3)
Using CORS in Google Cloud Storage
Authenticated access to Google APIs with CORS
CORS in IBM Cloudant
CORS in Windows Azure Storage
CORS in Box API
CORS in the Dropbox API
Summary
References
Chapter 7: CORS in Node.js
JavaScript frameworks are very popular
Introduction to Node.js
JavaScript frameworks that work with Node.js
CORS in Express.js
CORS npm for Express.js using Connect.js middleware
CORS in AngularJS
CORS in Backbone.js
Node.js and JavaScript frameworks are evolving rapidly
Summary
References
Chapter 8: CORS Best Practices
Enabling API to public CORS requests
Limiting API to allow CORS requests to a whitelisted set of origins
Protecting against cross-site request forgery (CSRF)
Summary

What You Will Learn

  • Why you need CORS: Bending the Same Origin Policy and basic CORS implementation, headers and XMLHttpRequest
  • Creating proxies for CORS: Sometimes the header is not enough
  • Security: vulnerabilities and how to secure your CORS application
  • CORS implementations in Content Management systems
  • Learn about CORS in Windows applications
  • Take CORS on the Cloud
  • Apply CORS in Node.js
  • Best practices for CORS

Authors

Table of Contents

Chapter 1: Why You Need CORS
The same-origin policy
Considering the origin of entities
Commonly allowed cross-origin resource sharing
Permissions required by JavaScript
How CORS works – the header and the request
CORS with Preflight
Troubleshooting and debugging CORS
CORS with jQuery
Enabling CORS globally with server configuration
Alternatives to CORS
Summary
Chapter 2: Creating Proxies for CORS
Proxies and the World Wide Web
What is a proxy server?
Reasons to use a proxy
Creating a proxy server with Google App Engine
Summary
Chapter 3: Usability and Security
CORS usability
Enhancing security in CORS
Summary
Chapter 4: CORS in Popular Content Management Frameworks
Incoming CORS requests
SAAS or self-hosted?
CORS in WordPress
CORS in Drupal
CORS in Joomla!
CORS in Adobe Experience Manager
Summary
Chapter 5: CORS in Windows
Incoming CORS requests
How to set the Access-Control-Allow-Origin header globally in Windows IIS Server
CORS in the ASP.NET Web API
CORS in Windows Communication Foundation
CORS in Windows browsers – Internet Explorer and Edge
Summary
Chapter 6: CORS in the Cloud
CORS requests in cloud APIs
CORS in Amazon Simple Storage Service (S3)
Using CORS in Google Cloud Storage
Authenticated access to Google APIs with CORS
CORS in IBM Cloudant
CORS in Windows Azure Storage
CORS in Box API
CORS in the Dropbox API
Summary
References
Chapter 7: CORS in Node.js
JavaScript frameworks are very popular
Introduction to Node.js
JavaScript frameworks that work with Node.js
CORS in Express.js
CORS npm for Express.js using Connect.js middleware
CORS in AngularJS
CORS in Backbone.js
Node.js and JavaScript frameworks are evolving rapidly
Summary
References
Chapter 8: CORS Best Practices
Enabling API to public CORS requests
Limiting API to allow CORS requests to a whitelisted set of origins
Protecting against cross-site request forgery (CSRF)
Summary

Book Details

ISBN 139781784393779
Paperback144 pages
Read More

Read More Reviews

Recommended for You