CORS Essentials

Share code and assets across domains in Web applications with CORS
Preview in Mapt
Code Files

CORS Essentials

Rajesh Gunasundaram, Randall Goya

Share code and assets across domains in Web applications with CORS
Mapt Subscription
FREE
$29.99/m after trial
eBook
$19.60
RRP $27.99
Save 29%
Print + eBook
$34.99
RRP $34.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$19.60
$34.99
$29.99p/m after trial
RRP $27.99
RRP $34.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


CORS Essentials Book Cover
CORS Essentials
$ 27.99
$ 19.60
CoreOS Essentials Book Cover
CoreOS Essentials
$ 27.99
$ 19.60
Buy 2 for $35.00
Save $20.98
Add to Cart
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 

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

CoreOS Essentials Book Cover
CoreOS Essentials
$ 27.99
$ 19.60
IBM Lotus Sametime 8 Essentials: A User's Guide Book Cover
IBM Lotus Sametime 8 Essentials: A User's Guide
$ 26.99
$ 18.90
Microsoft AJAX Library Essentials: Client-side ASP.NET AJAX 1.0 Explained Book Cover
Microsoft AJAX Library Essentials: Client-side ASP.NET AJAX 1.0 Explained
$ 23.99
$ 16.80
CherryPy Essentials: Rapid Python Web Application Development Book Cover
CherryPy Essentials: Rapid Python Web Application Development
$ 23.99
$ 16.80
State management in Vue.js and Firebase essentials [Integrated Course] Book Cover
State management in Vue.js and Firebase essentials [Integrated Course]
$ 124.99
$ 106.25
ASP.NET Core Essentials Book Cover
ASP.NET Core Essentials
$ 27.99
$ 19.60