Line 2: | Line 2: | ||
__TOC__ | __TOC__ | ||
==Overview== | ==Overview== | ||
− | Web Services supports Cross | + | Web Services supports Cross-Origin Resource Sharing (CORS), which allows applications to request resources from another domain. For general information and background on CORS, see {{#Widget:ExtLink|link=http://en.wikipedia.org/wiki/Cross-origin_resource_sharing|displaytext=Cross-Origin Resource Sharing}}. |
− | For | ||
− | + | To set up Cross-Origin Resource Sharing, make sure you set the [[HTCCConfigurationOptionsReference#crossOriginSettings|crossOriginSettings]] option in the '''server-settings.yaml''' file on each of your Web Services nodes. It specifies the configuration for cross-origin resource sharing in Web Services. Make sure this option has the '''exposedHeaders''' setting with a value that includes <tt>X-CSRF-HEADER,X-CSRF-TOKEN</tt>. | |
− | Web Services | ||
− | + | For example, your configuration might look like this: | |
− | + | <source lang="text"> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | For example: <source lang=" | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
crossOriginSettings: | crossOriginSettings: | ||
corsFilterCacheTimeToLive: 120 | corsFilterCacheTimeToLive: 120 | ||
− | allowedOrigins: | + | allowedOrigins: http://*.genesys.com, http://*.genesyslab.com |
allowedMethods: GET,POST,PUT,DELETE,OPTIONS | allowedMethods: GET,POST,PUT,DELETE,OPTIONS | ||
allowedHeaders: "X-Requested-With,Content-Type,Accept,Origin,Cookie,authorization,ssid,surl,ContactCenterId,X-CSRF-TOKEN" | allowedHeaders: "X-Requested-With,Content-Type,Accept,Origin,Cookie,authorization,ssid,surl,ContactCenterId,X-CSRF-TOKEN" | ||
allowCredentials: true | allowCredentials: true | ||
exposedHeaders: "X-CSRF-HEADER,X-CSRF-TOKEN" | exposedHeaders: "X-CSRF-HEADER,X-CSRF-TOKEN" | ||
− | </ | + | </source> |
+ | For more information about CORS in the Web Services API, see [[Documentation:HTCC:API:CORS|Cross-Origin Resource Sharing]]. | ||
==Next step== | ==Next step== |
Revision as of 13:40, February 1, 2016
CORS filter
Contents
Overview
Web Services supports Cross-Origin Resource Sharing (CORS), which allows applications to request resources from another domain. For general information and background on CORS, see Cross-Origin Resource Sharing.
To set up Cross-Origin Resource Sharing, make sure you set the crossOriginSettings option in the server-settings.yaml file on each of your Web Services nodes. It specifies the configuration for cross-origin resource sharing in Web Services. Make sure this option has the exposedHeaders setting with a value that includes X-CSRF-HEADER,X-CSRF-TOKEN.
For example, your configuration might look like this:
crossOriginSettings:
corsFilterCacheTimeToLive: 120
allowedOrigins: http://*.genesys.com, http://*.genesyslab.com
allowedMethods: GET,POST,PUT,DELETE,OPTIONS
allowedHeaders: "X-Requested-With,Content-Type,Accept,Origin,Cookie,authorization,ssid,surl,ContactCenterId,X-CSRF-TOKEN"
allowCredentials: true
exposedHeaders: "X-CSRF-HEADER,X-CSRF-TOKEN"
For more information about CORS in the Web Services API, see Cross-Origin Resource Sharing.
Next step
Comments or questions about this documentation? Contact us for support!